DVAuthAuthorization class
Methods
-
acceptsCaller(String action, Object? user)
→ bool
-
Whether the policy for
action, named as Resource.action, can be
called with user as its caller and no resource.
-
authorize<TUser, TResource>(TUser user, String action, TResource resource)
→ Future<void>
-
-
can<TUser, TResource>(TUser user, String action, TResource resource)
→ Future<bool>
-
-
canAction(Object? user, String action, {Object? resource})
→ Future<bool>
-
Whether
user may action, named as Resource.action, optionally on
resource.
-
noSuchMethod(Invocation invocation)
→ dynamic
-
Invoked when a nonexistent method or property is accessed.
inherited
-
register<TUser, TResource>(String action, DVPolicyCheck<TUser, TResource> check)
→ void
-
Registers the application's own answer for
action on TResource.
-
registerAction(String action, FutureOr<bool> check(Object? caller, Object? resource))
→ void
-
Registers the application's own answer for
action, named as
Resource.action, where there is no Dart type for the resource.
-
registerDeclared<TUser, TResource>(String action, DVPolicyCheck<TUser, TResource> check)
→ void
-
Registers a
@DVPolicy class's method. Called by the generated client
and server; the application's own register for the same action and
resource is asked instead.
-
registerDeclaredAction(String action, FutureOr<bool> check(Object? caller, Object? resource))
→ void
-
A framework default for
action, asked only where the application
registered nothing for it.
-
requiresCaller(String action)
→ bool
-
Whether the policy for
action needs a caller: its user parameter is
not nullable, so a request that authenticated nobody cannot be asked
about. Judged on the user alone -- a policy that also needs a resource
is refused for that, which signing in would not change. False for an
action nothing registered.
-
toString()
→ String
-
A string representation of this object.
inherited
Static Methods
-
reset()
→ void
-
Forgets every registered policy. For a test: a process registers its
policies once, at start.