TransientGrantingPermissionService class
namespace: Serenity.Web assembly: Serenity.Net.Core
Adds temporary granting support to any IPermissionService implementation
public class TransientGrantingPermissionService : IPermissionService, ITransientGrantor
Public Members
name | description |
---|---|
TransientGrantingPermissionService(…) | Creates a new TransientGrantingPermissionService wrapping passed service |
Grant(…) | Grants specified permissions temporarily (or makes it look like) |
GrantAll() | Grants all permissions temporarily (or makes it look like) |
HasPermission(…) | Checks if user has specified permission |
UndoGrant() | Undoes last grant or grant all operation |
Remarks
Register this class in your application start, to allow granting permissions temporarily.
registrar.RegisterInstance<IPermissionService>(new TransientGrantingPermissionService(new MyPermissionService()))
See Also
- interface IPermissionService
- interface ITransientGrantor
- Source: TransientGrantingPermissionService.cs