Class PermissionManager
- Namespace
- Dynamicweb.Security.Permissions
- Assembly
- Dynamicweb.Core.dll
Provides methods for retrieving and managing permissions within the current permission context.
public static class PermissionManager
- Inheritance
-
PermissionManager
- Inherited Members
Methods
GetExplicitPermissionsByType<T>()
Gets all explicit permissions for the specified entity type.
public static IEnumerable<Permission> GetExplicitPermissionsByType<T>() where T : IPermissionEntity
Returns
- IEnumerable<Permission>
Permissions for the specified entity type, if found; otherwise, an empty sequence.
Type Parameters
T
Permission entity type to get permissions for
GetPermissionIdentifier(IPermissionEntity)
public static PermissionEntityIdentifier? GetPermissionIdentifier(IPermissionEntity entity)
Parameters
entity
IPermissionEntity
Returns
GetPermissionLevel(IPermissionEntity)
Gets the permission level for the specified entity.
public static PermissionLevel GetPermissionLevel(IPermissionEntity entity)
Parameters
entity
IPermissionEntityEntity to get permission for
Returns
- PermissionLevel
Permission level
HasPermissionLevel(IPermissionEntity, PermissionLevel)
Checks the current permission level for the specified entity.
public static bool HasPermissionLevel(IPermissionEntity entity, PermissionLevel level)
Parameters
entity
IPermissionEntityPermission entity
level
PermissionLevelPermission level
Returns
- bool
true
, if the specified permission level is satisfied by current permission; otherwise,false
.