Class ContentPermissionsQueryStringHandler
Used to authorize if the user has the correct permission access to the content for the content id specified in a query string.
Inheritance
System.Object
Microsoft.AspNetCore.Authorization.AuthorizationHandler<ContentPermissionsQueryStringRequirement>
Namespace: Umbraco.Cms.Web.BackOffice.Authorization
Assembly: Umbraco.Web.BackOffice.dll
Syntax
public class ContentPermissionsQueryStringHandler : PermissionsQueryStringHandler<ContentPermissionsQueryStringRequirement>, IAuthorizationHandler
Constructors
View SourceContentPermissionsQueryStringHandler(IBackOfficeSecurityAccessor, IHttpContextAccessor, IEntityService, ContentPermissions)
Initializes a new instance of the ContentPermissionsQueryStringHandler class.
Declaration
public ContentPermissionsQueryStringHandler(IBackOfficeSecurityAccessor backOfficeSecurityAccessor, IHttpContextAccessor httpContextAccessor, IEntityService entityService, ContentPermissions contentPermissions)
Parameters
Type | Name | Description |
---|---|---|
IBackOfficeSecurityAccessor | backOfficeSecurityAccessor | Accessor for back-office security. |
Microsoft.AspNetCore.Http.IHttpContextAccessor | httpContextAccessor | Accessor for the HTTP context of the current request. |
IEntityService | entityService | Service for entity operations. |
ContentPermissions | contentPermissions | Helper for content authorization checks. |
Methods
View SourceIsAuthorized(AuthorizationHandlerContext, ContentPermissionsQueryStringRequirement)
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, ContentPermissionsQueryStringRequirement requirement)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.AspNetCore.Authorization.AuthorizationHandlerContext | context | The authorization context. |
ContentPermissionsQueryStringRequirement | requirement |
Returns
Type | Description |
---|---|
Task<System.Boolean> | True if request is authorized, false if not. |