Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
SinglePrivilege.cs
2{
6 public class SinglePrivilege<T> : IAuthorization<T>
7 {
8 private readonly string privilege;
9
14 public SinglePrivilege(string Privilege)
15 {
16 this.privilege = Privilege;
17 }
18
25 public bool IsAuthorized(T Resource, IHasPrivileges User)
26 {
27 return User.HasPrivilege(this.privilege);
28 }
29 }
30}
Authorization based on a single privilege.
SinglePrivilege(string Privilege)
Authorization based on a single 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.