Class TreeHandler
Ensures that the current user has access to the section for which the specified tree(s) belongs
Namespace: Umbraco.Cms.Web.BackOffice.Authorization
Assembly: Umbraco.Web.BackOffice.dll
Syntax
public class TreeHandler : MustSatisfyRequirementAuthorizationHandler<TreeRequirement>, IAuthorizationHandler
Remarks
This would allow a tree to be moved between sections. The user only needs access to one of the trees specified, not all of the trees.
Constructors
View SourceTreeHandler(ITreeService, IBackOfficeSecurityAccessor)
Initializes a new instance of the TreeHandler class.
Declaration
public TreeHandler(ITreeService treeService, IBackOfficeSecurityAccessor backOfficeSecurityAccessor)
Parameters
| Type | Name | Description |
|---|---|---|
| ITreeService | treeService | Service for section tree operations. |
| IBackOfficeSecurityAccessor | backOfficeSecurityAccessor | Accessor for back-office security. |
Methods
View SourceIsAuthorized(AuthorizationHandlerContext, TreeRequirement)
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, TreeRequirement requirement)
Parameters
| Type | Name | Description |
|---|---|---|
| Microsoft.AspNetCore.Authorization.AuthorizationHandlerContext | context | The authorization context. |
| TreeRequirement | requirement |
Returns
| Type | Description |
|---|---|
| Task<System.Boolean> | True if request is authorized, false if not. |