Class SectionHandler
Ensures that the current user has access to the section
Inheritance
System.Object
Microsoft.AspNetCore.Authorization.AuthorizationHandler<SectionRequirement>
Namespace: Umbraco.Cms.Web.BackOffice.Authorization
Assembly: Umbraco.Web.BackOffice.dll
Syntax
public class SectionHandler : MustSatisfyRequirementAuthorizationHandler<SectionRequirement>, IAuthorizationHandler
Remarks
The user only needs access to one of the sections specified, not all of the sections.
Constructors
View SourceSectionHandler(IBackOfficeSecurityAccessor)
Initializes a new instance of the SectionHandler class.
Declaration
public SectionHandler(IBackOfficeSecurityAccessor backOfficeSecurityAccessor)
Parameters
Type | Name | Description |
---|---|---|
IBackOfficeSecurityAccessor | backOfficeSecurityAccessor | Accessor for back-office security. |
Methods
View SourceIsAuthorized(AuthorizationHandlerContext, SectionRequirement)
Return true if the requirement is succeeded or ignored, return false if the requirement is explicitly not met
Declaration
protected override Task<bool> IsAuthorized(AuthorizationHandlerContext context, SectionRequirement requirement)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.AspNetCore.Authorization.AuthorizationHandlerContext | context | The authorization context. |
SectionRequirement | requirement |
Returns
Type | Description |
---|---|
Task<System.Boolean> | True if request is authorized, false if not. |