Class UserGroupHandler
Authorizes that the current user has access to the user group Id in the request
Inheritance
System.Object
Microsoft.AspNetCore.Authorization.AuthorizationHandler<UserGroupRequirement>
Namespace: Umbraco.Cms.Web.BackOffice.Authorization
Assembly: Umbraco.Web.BackOffice.dll
Syntax
public class UserGroupHandler : MustSatisfyRequirementAuthorizationHandler<UserGroupRequirement>, IAuthorizationHandler
Constructors
View SourceUserGroupHandler(IHttpContextAccessor, IUserService, IContentService, IMediaService, IEntityService, IBackOfficeSecurityAccessor, AppCaches)
Initializes a new instance of the UserGroupHandler class.
Declaration
public UserGroupHandler(IHttpContextAccessor httpContextAccessor, IUserService userService, IContentService contentService, IMediaService mediaService, IEntityService entityService, IBackOfficeSecurityAccessor backOfficeSecurityAccessor, AppCaches appCaches)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.AspNetCore.Http.IHttpContextAccessor | httpContextAccessor | Accessor for the HTTP context of the current request. |
IUserService | userService | Service for user related operations. |
IContentService | contentService | Service for content related operations. |
IMediaService | mediaService | Service for media related operations. |
IEntityService | entityService | Service for entity related operations. |
IBackOfficeSecurityAccessor | backOfficeSecurityAccessor | Accessor for back-office security. |
AppCaches | appCaches | App caches. |
Methods
View SourceIsAuthorized(AuthorizationHandlerContext, UserGroupRequirement)
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, UserGroupRequirement requirement)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.AspNetCore.Authorization.AuthorizationHandlerContext | context | The authorization context. |
UserGroupRequirement | requirement |
Returns
Type | Description |
---|---|
Task<System.Boolean> | True if request is authorized, false if not. |