Skip to content

TransientGrantingPermissionService constructor

Decorates an IPermissionService to support temporarily granting permissions.

public TransientGrantingPermissionService(IPermissionService? permissionService = null, 
    IHttpContextItemsAccessor? requestContext = null)
parameter description
permissionService The underlying permission service to delegate to when no transient grant is active.
requestContext The accessor that provides per-request storage for the granting stack.

Remarks

Register this decorator at application startup to enable temporary permission grants.

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

Creates a new instance of the TransientGrantingPermissionService class wrapping the specified service.

See Also