AccessScope

class AccessScope<S : Any>

What an access policy's predicates are written with, for the aggregates whose state is S: comparisons of their access attributes (<State>Access, typed by S) with the caller's claims, and logic. A comparison with a claim the caller does not hold, a null or no values, denies (AccessPredicate.Unknown), as does one of a value the aggregate does not have.

Functions

Link copied to clipboard
fun allOf(vararg predicates: AccessPredicate): AccessPredicate

Each of predicates holds; always when none is given.

Link copied to clipboard

Every aggregate: public data, said explicitly.

Link copied to clipboard

Every aggregate when condition holds, none otherwise: a condition on the caller alone, such as a role.

Link copied to clipboard
fun anyOf(vararg predicates: AccessPredicate): AccessPredicate

One of predicates holds; never when none is given.

Link copied to clipboard
fun Caller.claim(name: String): String?

The first value of the caller's claim name, or null when the caller does not hold it.

Link copied to clipboard

The values of the caller's claim name, none when the caller does not hold it.

Link copied to clipboard

The attribute's values hold value.

Link copied to clipboard

The attribute's values hold one of values.

Link copied to clipboard

No aggregate: write { denyAll() } for one no caller changes.

Link copied to clipboard
infix fun <V : Any> AccessAttribute.Single<S, V>.eq(value: V?): AccessPredicate

The attribute's value is value.

Link copied to clipboard

Whether the caller holds the role role: one of the values of its roles claim.

Link copied to clipboard

The attribute holds no value.

Link copied to clipboard

The attribute's value is one of values.

Link copied to clipboard

The aggregate has no value of the attribute.

Link copied to clipboard

predicate does not hold, of a value the aggregate has: an absent value grants neither way.

Link copied to clipboard
fun ownerAndSpace(caller: Caller, ownership: Ownership = Ownership.OWNER): AccessPredicate

The default rule of caller (ScopeAccess): the aggregates whose owner is the owner of the scope the caller acts in and whose space is its space, each part compared only when the scope names it, and no owner for an aggregate of its tenant (ownership). A policy replaces the default rule for its aggregate, so one that keeps the aggregates to their owner and space combines its own attributes with this: allOf(DocumentStateAccess.APP eq caller.app, ownerAndSpace(caller)).

Link copied to clipboard

The attribute's value, a string, starts with prefix: a level of a materialized path, say.