TransientGrantingPermissionService class

namespace: Serenity.Web   assemblySerenity.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


Register this class in your application start, to allow granting permissions temporarily.

registrar.RegisterInstance<IPermissionService>(new TransientGrantingPermissionService(new MyPermissionService()))

See Also