TAuthController class
Holds the externally supplied permission list and resolves checks.
Provide it with TAuthScope; call update after login/logout/refresh and every dependent widget rebuilds.
- Inheritance
-
- Object
- ChangeNotifier
- TAuthController
Constructors
-
TAuthController({Iterable<
String> ? permissions, TPermissionGranter? granter, TAuthConfig config = const TAuthConfig(), bool loading = false}) -
With no
permissionsand nogranterthe controller is unconfigured and allows everything. Once a list is supplied (even an empty one), any permission not in it is denied.
Properties
- config → TAuthConfig
-
Defaults for denied handling.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasListeners → bool
-
Whether any listeners are currently registered.
no setterinherited
- isConfigured → bool
-
Whether a permission list has been supplied.
no setter
- loading → bool
-
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
addListener(
VoidCallback listener) → void -
Register a closure to be called when the object changes.
inherited
-
check(
Object? permission, {required TAuthTarget target, TAuthMode? onDenied}) → TAuthResult -
Checks
permission(String or TPermission); null permission is always allowed. -
dispose(
) → void -
Discards any resources used by the object.
inherited
-
has(
Object permission) → bool -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notifyListeners(
) → void -
Call all the registered listeners.
inherited
-
removeListener(
VoidCallback listener) → void -
Remove a previously registered closure from the list of closures that are
notified when the object changes.
inherited
-
setGranter(
TPermissionGranter granter) → void -
setLoading(
bool value) → void -
toString(
) → String -
A string representation of this object.
inherited
-
update(
Iterable< String> permissions) → void - Replaces the permission list and marks loading finished.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited