PermissionHandler.static constructor
PermissionHandler.static({})
Implementation
PermissionHandler.static({
bool? read,
bool? update,
bool? delete,
bool? create,
bool? write,
required bool defaultPermission,
}) : beforeNeed = false,
assert(write == null ||
(update == null && delete == null && create == null)) {
var defaultsMap = {
if (write != null) DbOperationType.create: write,
if (write != null) DbOperationType.update: write,
if (write != null) DbOperationType.delete: write,
if (read != null) DbOperationType.read: read,
if (update != null) DbOperationType.update: update,
if (create != null) DbOperationType.create: create,
if (delete != null) DbOperationType.delete: delete
};
checker = (_) {
return defaultsMap[_.type] ?? defaultPermission;
};
}