Class MediaPermissionsQueryStringHandler
Used to authorize if the user has the correct permission access to the media for the media id specified in a query string.
Inheritance
System.Object
Microsoft.AspNetCore.Authorization.AuthorizationHandler<MediaPermissionsQueryStringRequirement>
Namespace: Umbraco.Cms.Web.BackOffice.Authorization
Assembly: Umbraco.Web.BackOffice.dll
Syntax
public class MediaPermissionsQueryStringHandler : PermissionsQueryStringHandler<MediaPermissionsQueryStringRequirement>, IAuthorizationHandler
Constructors
View SourceMediaPermissionsQueryStringHandler(IBackOfficeSecurityAccessor, IHttpContextAccessor, IEntityService, MediaPermissions)
Initializes a new instance of the MediaPermissionsQueryStringHandler class.
Declaration
public MediaPermissionsQueryStringHandler(IBackOfficeSecurityAccessor backOfficeSecurityAccessor, IHttpContextAccessor httpContextAccessor, IEntityService entityService, MediaPermissions mediaPermissions)
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. |
MediaPermissions | mediaPermissions | Helper for media authorization checks. |
Methods
View SourceIsAuthorized(AuthorizationHandlerContext, MediaPermissionsQueryStringRequirement)
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, MediaPermissionsQueryStringRequirement requirement)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.AspNetCore.Authorization.AuthorizationHandlerContext | context | The authorization context. |
MediaPermissionsQueryStringRequirement | requirement |
Returns
Type | Description |
---|---|
Task<System.Boolean> | True if request is authorized, false if not. |