Namespace Dynamicweb.Security.Permissions
Classes
- Permission
Represents a configured permission for a permission owner (user group or role).
- PermissionContext
Provides context information for permission checks.
- PermissionEntityAttribute
Attribute to mark a class as a permission entity with a specified permission name.
- PermissionEntityIdentifier
A permission entity identifier is a unique identifier for "something" that has a permission level.
- PermissionEntityLookupManager
Provides functionality for looking up instances of IPermissionEntity based on key and name.
- PermissionLevelExtensions
Extension class for parsing permission levels.
- PermissionManager
Provides methods for retrieving and managing permissions within the current permission context.
- PermissionQuery
A permission query is a description of what parameters you want use for quering the permission storage.
Name="Page" + Key="123" will return all permissions related to a Page with Id "123"
- PermissionSection
Permission section.
- PermissionService
Handles fetching, adding, updating and removing permissions in the system.
- PermissionSubset
Represents a subset of a permission entity.
Interfaces
- IPermissionEntity
A permission entity can be used with the permission framework to get the PermissionLevel for a given user.
- IPermissionEntityLookup
Provides lookup functionality for a specific type of IPermissionEntity.
- IPermissionEvaluator
Evaluates permission levels on IPermissionEntity instances.
This is not an extensibility point - it exists to allow constructor injection and unit testing of components that need to check permissions.
Inject via constructor and use in place of the static HasPermissionextension method:internal AssortmentSaveCommand( IPermissionEvaluator permissionEvaluator, AssortmentService assortmentService) { _permissionEvaluator = permissionEvaluator; _assortmentService = assortmentService; } public override CommandResult Handle() { var entity = _assortmentService.GetAssortmentById(id); if (!_permissionEvaluator.HasPermission(entity, PermissionLevel.Edit)) return new() { Status = CommandResult.ResultType.NotAllowed }; // ... continue with handling }
Enums
- PermissionLevel
Indicates how high a level of permission is allowed.