AccessControlUtils class
Utility class providing static methods to perform quick access control checks within the widget tree.
These methods allow conditionally showing widgets or
enabling features based on access logic without the need
to wrap the widget in AccessControl.
Constructors
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
-
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
-
hasAnyPermission(
BuildContext context, List< String> permissions) → bool -
Returns true if the user has any of the
permissionslisted. -
hasAnyRole(
BuildContext context, List< String> roles) → bool -
Returns true if the user has any of the
roleslisted. -
hasPermission(
BuildContext context, String permission) → bool -
Returns true if the current user has the given
permission. -
hasRole(
BuildContext context, String role) → bool -
Returns true if the current user has the given
role. -
isOnPlan(
BuildContext context, String plan) → bool -
Returns true if the user's subscription
planmatches.