Package org.apache.nifi.authorization
Class AuthorizationResult
java.lang.Object
org.apache.nifi.authorization.AuthorizationResult
Represents a decision whether authorization is granted.
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionprivate static final AuthorizationResult
private final String
private static final AuthorizationResult
private final AuthorizationResult.Result
-
Constructor Summary
ModifierConstructorDescriptionprivate
AuthorizationResult
(AuthorizationResult.Result result, String explanation) Creates a new AuthorizationResult with the specified result and explanation. -
Method Summary
Modifier and TypeMethodDescriptionstatic AuthorizationResult
approved()
static AuthorizationResult
denied()
Creates a new denied AuthorizationResult with a message indicating 'Access is denied'.static AuthorizationResult
Creates a new denied AuthorizationResult with the specified explanation.static AuthorizationResult
Resource not found will indicate that there are no specific authorization rules for this resource.
-
Field Details
-
APPROVED
-
RESOURCE_NOT_FOUND
-
result
-
explanation
-
-
Constructor Details
-
AuthorizationResult
Creates a new AuthorizationResult with the specified result and explanation.- Parameters:
result
- of the authorizationexplanation
- for the authorization attempt
-
-
Method Details
-
getResult
- Returns:
- Whether or not the request is approved
-
getExplanation
- Returns:
- If the request is denied, the reason why. Null otherwise
-
approved
- Returns:
- a new approved 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
Creates a new denied AuthorizationResult with a message indicating 'Access is denied'.- Returns:
- a new denied AuthorizationResult
-
denied
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
-