A
This commit is contained in:
@@ -52,7 +52,11 @@ class PermissionsProvider extends ChangeNotifier {
|
||||
}
|
||||
|
||||
/// Load the [UserAccess] for the current venue.
|
||||
Future<UserAccess?> load() async {
|
||||
Future<UserAccess?> load() async {
|
||||
if (!_organizations.isOrganizationSet) {
|
||||
// Organization is not ready yet; skip loading until it becomes available.
|
||||
return _userAccess.data;
|
||||
}
|
||||
_userAccess = _userAccess.copyWith(isLoading: true, error: null);
|
||||
notifyListeners();
|
||||
|
||||
@@ -179,6 +183,10 @@ class PermissionsProvider extends ChangeNotifier {
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
Future<void> resetAsync() async {
|
||||
reset();
|
||||
}
|
||||
|
||||
bool canRead(ResourceType r, {Object? objectRef}) => canAccessResource(r, action: perm.Action.read, objectRef: objectRef);
|
||||
bool canUpdate(ResourceType r, {Object? objectRef}) => canAccessResource(r, action: perm.Action.update, objectRef: objectRef);
|
||||
bool canDelete(ResourceType r, {Object? objectRef}) => canAccessResource(r, action: perm.Action.delete, objectRef: objectRef);
|
||||
|
||||
Reference in New Issue
Block a user