Class ContentPermissionsResourceHandler
Used to authorize if the user has the correct permission access to the content for the
Inheritance
System.Object
Microsoft.AspNetCore.Authorization.AuthorizationHandler<ContentPermissionsResourceRequirement, ContentPermissionsResource>
MustSatisfyRequirementAuthorizationHandler<ContentPermissionsResourceRequirement, ContentPermissionsResource>
Namespace: Umbraco.Cms.Web.BackOffice.Authorization
Assembly: Umbraco.Web.BackOffice.dll
Syntax
public class ContentPermissionsResourceHandler : MustSatisfyRequirementAuthorizationHandler<ContentPermissionsResourceRequirement, ContentPermissionsResource>, IAuthorizationHandler
Constructors
View SourceContentPermissionsResourceHandler(IBackOfficeSecurityAccessor, ContentPermissions)
Initializes a new instance of the ContentPermissionsResourceHandler class.
Declaration
public ContentPermissionsResourceHandler(IBackOfficeSecurityAccessor backOfficeSecurityAccessor, ContentPermissions contentPermissions)
Parameters
Type | Name | Description |
---|---|---|
IBackOfficeSecurityAccessor | backOfficeSecurityAccessor | Accessor for back-office security. |
ContentPermissions | contentPermissions | Helper for content authorization checks. |
Methods
View SourceIsAuthorized(AuthorizationHandlerContext, ContentPermissionsResourceRequirement, ContentPermissionsResource)
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, ContentPermissionsResourceRequirement requirement, ContentPermissionsResource resource)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.AspNetCore.Authorization.AuthorizationHandlerContext | context | The authorization context. |
ContentPermissionsResourceRequirement | requirement | |
ContentPermissionsResource | resource |
Returns
Type | Description |
---|---|
Task<System.Boolean> | True if request is authorized, false if not. |