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
TPermission entity type to get permissions for
GetPermissionIdentifier(IPermissionEntity)
public static PermissionEntityIdentifier? GetPermissionIdentifier(IPermissionEntity entity)
Parameters
entityIPermissionEntity
Returns
GetPermissionLevel(IPermissionEntity)
Gets the permission level for the specified entity.
public static PermissionLevel GetPermissionLevel(IPermissionEntity entity)
Parameters
entityIPermissionEntityEntity to get permission for
Returns
- PermissionLevel
Permission level
GetPermissionName<T>()
Get the Name value of the PermissionEntityAttribute for the specified type. If the attribute is not present, the type name is returned.
public static string GetPermissionName<T>() where T : IPermissionEntity
Returns
Type Parameters
T
HasPermissionLevel(IPermissionEntity, PermissionLevel)
Checks the current permission level for the specified entity.
public static bool HasPermissionLevel(IPermissionEntity entity, PermissionLevel level)
Parameters
entityIPermissionEntityPermission entity
levelPermissionLevelPermission level
Returns
- bool
true, if the specified permission level is satisfied by current permission; otherwise,false.