The interface for a Security descriptor, i e something that allows for checking access rights.
Assembly: EPiServer.dllVersion: 11.20.7
public interface ISecurityDescriptor
Retreives the access level for the specified principal.
AccessLevel GetAccessLevel(IPrincipal principal)
The principal get access rights for.
The access level that the specified principal has.
Use this method when you want to get the union of all access types granted to this principal. This is most likely only used for display purposes in the user interface. Code that checks access and performs different actions depending on the type of access granted should use the HasAccess method, since it does what you want and has the potential for being much faster.
If the current ISecurityDescriptor is inherited, this method checks the inherited access rights.
Determines whether the specified principal has the requested access.
bool HasAccess(IPrincipal principal, AccessLevel access)
The principal to authorize.
The requested access level.
Note that the access level is a bitmask, i.e. we simply check that all specified access types are granted to the principal.
If the current ISecurityDescriptor is inherited, this method will check the inherited access rights.