Class AuthorizeHelper
Authorises the ClaimsPrincipal in the view's
Microsoft.AspNetCore.Http.HttpContext against policies, claims and roles. If either
authorisation fails, the HTML element is suppressed.
Inheritance
Microsoft.AspNetCore.Razor.TagHelpers.TagHelper
AuthorizeHelper
Namespace: XploRe.AspNetCore.Mvc.TagHelpers
Assembly: XploRe.AspNetCore.Mvc.TagHelpers.dll
Syntax
public class AuthorizeHelper : TagHelper
Constructors
Name | Description |
---|---|
AuthorizeHelper(IAuthorizationService) | Initialises a new AuthorizeHelper instance. |
Properties
Name | Description |
---|---|
AuthorizationService | The cached Microsoft.AspNetCore.Authorization.IAuthorizationService service instance. |
Policy | Policy to authorise user against if set. Can either be an Microsoft.AspNetCore.Authorization.AuthorizationPolicy instance or the name of a policy to check. The name of the policy must have been registered, otherwise an InvalidOperationException is thrown when evaluating the policy. |
ViewContext | The automatically assigned ViewContext instance. |
Methods
Name | Description |
---|---|
ProcessAsync(TagHelperContext, TagHelperOutput) |