AuthResponse class final

Result of an authorization check with an optional message and code.

Constructors

AuthResponse.allow([String? message])
const
AuthResponse.deny([String? message = 'This action is unauthorized.', Object? code])
const

Properties

allowed → bool
final
code → Object?
final
denied → bool
no setter
hashCode → int
The hash code for this object.
no setterinherited
message → String?
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

authorize() → void
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.