Class AuthorizationResult

java.lang.Object
org.apache.nifi.authorization.AuthorizationResult

public class AuthorizationResult extends Object
Represents a decision whether authorization is granted.
  • Field Details

  • Constructor Details

    • AuthorizationResult

      private AuthorizationResult(AuthorizationResult.Result result, String explanation)
      Creates a new AuthorizationResult with the specified result and explanation.
      Parameters:
      result - of the authorization
      explanation - for the authorization attempt
  • Method Details

    • getResult

      public AuthorizationResult.Result getResult()
      Returns:
      Whether or not the request is approved
    • getExplanation

      public String getExplanation()
      Returns:
      If the request is denied, the reason why. Null otherwise
    • approved

      public static AuthorizationResult approved()
      Returns:
      a new approved AuthorizationResult
    • resourceNotFound

      public static AuthorizationResult resourceNotFound()
      Resource not found will indicate that there are no specific authorization rules for this resource.
      Returns:
      a new resource not found AuthorizationResult
    • denied

      public static AuthorizationResult denied()
      Creates a new denied AuthorizationResult with a message indicating 'Access is denied'.
      Returns:
      a new denied AuthorizationResult
    • denied

      public static AuthorizationResult denied(String explanation)
      Creates a new denied AuthorizationResult with the specified explanation.
      Parameters:
      explanation - for why it was denied
      Returns:
      a new denied AuthorizationResult with the specified explanation
      Throws:
      IllegalArgumentException - if explanation is null