StateVisibility

Whether a caller sees one aggregate's state as the snapshot queries of its type show it: the state, as the snapshot-shaped record a query reads, admitted by QueryGateway.admitRecord of the type's snapshot query gateway, so the caller scope and the access policies hide from a state read by id, a version and a trace the rows they hide from a query. A type without a snapshot query gateway has no policies to apply, and every state of it is visible.

What a state read returns is admitted: the state masked as the snapshot queries mask it (the 9.x PointReadAdmission), for every caller alike, as a query masks every row whoever asks.

The record is read by id with every deletion state: a state read answers a deleted aggregate as any other.

Functions

Link copied to clipboard
suspend fun admitted(gateway: QueryGateway?, caller: QueryCaller, state: Snapshot<JsonNode>, masks: PayloadMasks = PayloadMasks.NONE): JsonNode?

The tree of state as caller may see it: masked as the snapshot queries of its type mask it, or null when they hide it. With a gateway, its admitted record's state, masked by the schema its queries are masked by; without one, the tree masked by masks, the masks the Manifest declares. The tree may be masked in place.

Link copied to clipboard
suspend fun masked(gateway: QueryGateway?, state: Snapshot<JsonNode>, masks: PayloadMasks = PayloadMasks.NONE): JsonNode

The tree of state masked as the snapshot queries of its type mask it, no policy evaluated: with a gateway, by the schema its queries are masked by (QueryGateway.maskRecord), else by masks.

Link copied to clipboard
suspend fun visible(gateway: QueryGateway?, caller: QueryCaller, state: Snapshot<JsonNode>): Boolean

Whether caller may see state, whose tree may be masked in place (admitted).