ZenithAuthorizationService class

Evaluates ZenithPolicy instances against UserSecurityContexts.

final service = ZenithAuthorizationService();
final result = service.evaluate(userContext, exportPolicy);
if (result.isAuthorized) { /* proceed */ }

Constructors

ZenithAuthorizationService()
Creates a ZenithAuthorizationService.
const

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

evaluate(UserSecurityContext context, ZenithPolicy policy) → AuthorizationResult
All supplied conditions must pass. Empty or throwing policies deny access. Async loading and error states never grant access.
evaluateState(UserSecurityContext context, ZenithPolicy policy, {PolicyRef? ref}) → AsyncValue<bool>
Shared evaluation for route guards and reactive authorization widgets.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited