Nucleus .Net Core CMS

Managers.IPermissionsManager Interface

Namespace: Nucleus.Abstractions.Managers
Assembly: Nucleus.Abstractions.dll
Defines the interface for the permissions manager.
Get an instance of this class from dependency injection by including a parameter in your class constructor. A general design principle for Manager classes in Nucleus is that they should not include another Manager class as a dependency to avoid circular references, but the PermissionsManager (this class) is one of two exceptions to that rule, the other one being Managers.ICacheManager.
AddPermissionType (PermissionType permissionType)
Create a new permission type.
Parameters
Name Type
permissionType Nucleus.Abstractions.Models.PermissionType
Remarks
If the permission type already exists, this function does nothing, and does not throw an exception.
DeletePermissions (IEnumerable<Permission> permissions)
Delete all permissions for the entity specified by Id.
Parameters
Name Type
permissions System.Collections.Generic.IEnumerable<Nucleus.Abstractions.Models.Permission>
ListPermissions (Guid relatedId, String permissionNameSpace)
List all permissions for the entity specified by Id.
Parameters
Name Type
relatedId Guid
permissionNameSpace String
ListPermissionTypes (String scopeNamespace)
List all permission types.
Parameters
Name Type
scopeNamespace String
SavePermissions (Guid relatedId, IEnumerable<Permission> permissions, IList<Permission> originalPermissions)
Save permissions for the entity specified by relatedId, and delete any existing permissions which exist in originalPermissions but no not exist in permissions.
Parameters
Name Type
relatedId Guid
permissions System.Collections.Generic.IEnumerable<Nucleus.Abstractions.Models.Permission>
originalPermissions System.Collections.Generic.IList<Nucleus.Abstractions.Models.Permission>