10 private readonly Func<T, string[]> calculatePrivileges;
18 if (CalculatePrivileges is
null)
19 throw new ArgumentNullException(nameof(CalculatePrivileges));
21 this.calculatePrivileges = CalculatePrivileges;
32 string[] Privileges = this.calculatePrivileges(Resource);
33 int i, c = Privileges.Length;
35 for (i = 0; i < c; i++)
Authorization based on a custom privileges.
bool IsAuthorized(T Resource, IHasPrivileges User)
Checks if an user or object is authorized to perform an action.
CustomPrivileges(Func< T, string[]> CalculatePrivileges)
Authorization based on a custom privileges.
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.