AuthorizationContext class
Combined authorization context containing both identity and authorization data
Constructors
- AuthorizationContext(AuthenticationData identity, AuthorizationData authorization)
- Creates authorization context with identity and authorization data
Properties
-
allRoles
→ List<
String> -
Combined roles from token and authorization service
no setter
-
attributes
→ Map<
String, dynamic> -
Authorization attributes from service
no setter
-
Authorization data from authorization provider
final
-
authzRoles
→ List<
String> -
Authorization roles from service
no setter
-
claims
→ Map<
String, dynamic> -
User claims from token
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- identity → AuthenticationData
-
Authentication data from token validation
final
-
permissions
→ List<
String> -
Authorization permissions from service
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
tokenRoles
→ List<
String> -
User roles from token
no setter
- userId → String
-
User ID from token
no setter
Methods
-
getAttribute<
T> (String key) → T? - Get attribute value by key
-
hasAllPermissions(
List< String> permissions) → bool - Check if user has all of the specified permissions
-
hasAllRoles(
List< String> roles) → bool - Check if user has all of the specified roles
-
hasAnyPermission(
List< String> permissions) → bool - Check if user has any of the specified permissions
-
hasAnyRole(
List< String> roles) → bool - Check if user has any of the specified roles
-
hasPermission(
String permission) → bool - Check if user has permission (checks both token and authorization service)
-
hasRole(
String role) → bool - Check if user has role (checks both token and authorization service)
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited