AccessPolicy
class AccessPolicy<S : Any> @InternalWowApi constructor(val stateType: Class<S>, val aggregate: AggregateType?, read: AccessScope<S>.(Caller) -> AccessPredicate, write: AccessScope<S>.(Caller) -> AccessPredicate)
Who may read and who may change the aggregates whose state is S: for a caller, a predicate over their access attributes (AccessPredicate) to read them and one to write them. A service declares one per aggregate whose state declares access attributes (@Access), as a bean; aggregate names the aggregate when several share the state type, null otherwise. Build one with accessPolicy.
A policy replaces the default rule (ScopeAccess) for its aggregate: the caller's owner and space are compared only where the policy compares them, so a policy that keeps the aggregates to their owner and space says so (AccessScope.ownerAndSpace).
Constructors
Link copied to clipboard
constructor(stateType: Class<S>, aggregate: AggregateType?, read: AccessScope<S>.(Caller) -> AccessPredicate, write: AccessScope<S>.(Caller) -> AccessPredicate)