AuthResponse class final
Result of an authorization check with an optional message and code.
Constructors
- AuthResponse.allow([String? message])
-
Allowed, with an optional
message.const - AuthResponse.deny([String? message = 'This action is unauthorized.', Object? code])
-
Denied, with a message and code for the 403.
const
Properties
- allowed → bool
-
Whether the action is allowed.
final
- code → Object?
-
An application code of the denial.
final
- denied → bool
-
Whether the action is denied.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- message → String?
-
The message of the answer, shown in a 403.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
- Throws AuthorizationException when denied.
-
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
Static Methods
-
from(
Object? result) → AuthResponse - Coerces a callback result into a response.