Search Results for

    Show / Hide Table of Contents
    View Source

    Class MustSatisfyRequirementAuthorizationHandler<T>

    Abstract handler that must satisfy the requirement so Succeed or Fail will be called no matter what.

    Inheritance
    System.Object
    Microsoft.AspNetCore.Authorization.AuthorizationHandler<T>
    Namespace: Umbraco.Cms.Web.BackOffice.Authorization
    Assembly: Umbraco.Web.BackOffice.dll
    Syntax
    public abstract class MustSatisfyRequirementAuthorizationHandler<T> : AuthorizationHandler<T>, IAuthorizationHandler where T : IAuthorizationRequirement
    Type Parameters
    Name Description
    T

    Authorization requirement.

    Remarks

    aspnetcore Authz handlers are not required to satisfy the requirement and generally don't explicitly call Fail when the requirement isn't satisfied, however in many simple cases explicitly calling Succeed or Fail is what we want which is what this class is used for.

    Methods

    View Source

    HandleRequirementAsync(AuthorizationHandlerContext, T)

    Declaration
    protected override async Task HandleRequirementAsync(AuthorizationHandlerContext context, T requirement)
    Parameters
    Type Name Description
    Microsoft.AspNetCore.Authorization.AuthorizationHandlerContext context
    T requirement
    Returns
    Type Description
    Task
    View Source

    IsAuthorized(AuthorizationHandlerContext, T)

    Return true if the requirement is succeeded or ignored, return false if the requirement is explicitly not met

    Declaration
    protected abstract Task<bool> IsAuthorized(AuthorizationHandlerContext context, T requirement)
    Parameters
    Type Name Description
    Microsoft.AspNetCore.Authorization.AuthorizationHandlerContext context

    The authorization context.

    T requirement

    The authorization requirement.

    Returns
    Type Description
    Task<System.Boolean>

    True if request is authorized, false if not.

    • Improve this Doc
    • View Source
    In This Article
    • Methods
      • HandleRequirementAsync(AuthorizationHandlerContext, T)
      • IsAuthorized(AuthorizationHandlerContext, T)
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX