10 private readonly Func<T, string> calculatePrivilege;
18 if (CalculatePrivilege is
null)
19 throw new ArgumentNullException(nameof(CalculatePrivilege));
21 this.calculatePrivilege = CalculatePrivilege;
32 string Privilege = this.calculatePrivilege(Resource);
Authorization based on a custom privilege.
CustomPrivilege(Func< T, string > CalculatePrivilege)
Authorization based on a custom privilege.
bool IsAuthorized(T Resource, IHasPrivileges User)
Checks if an user or object is authorized to perform an action.
Basic authorization interface for objects of type T .
Interface for objects that have privileges.
bool HasPrivilege(string Privilege)
If the object has a given privilege.