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