PermissionChecker class
Permission checker for the framework
Constructors
- PermissionChecker()
-
factory
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- isEnabled → bool
-
Check if permission checking is enabled
no setter
-
registeredModules
→ List<
String> -
Get all registered modules
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
checkPermission(
String moduleId, Permission permission, {String? resource, bool logViolation = true}) → bool - Check if a module has permission for an action
-
clear(
) → void - Clear all permissions (for testing)
-
disable(
) → void - Disable permission checking
-
enable(
) → void - Enable permission checking
-
getModulePermissions(
String moduleId) → ModulePermissions? - Get all permissions for a module
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
registerModule(
String moduleId, ModulePermissions permissions) → void - Register permissions for a module
-
requirePermission(
String moduleId, Permission permission, {String? resource}) → void - Check permission and throw if denied
-
toString(
) → String -
A string representation of this object.
inherited
-
unregisterModule(
String moduleId) → void - Unregister a module's permissions
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited