Package org.forgerock.authz.filter.api
Class AuthorizationResult
java.lang.Object
org.forgerock.authz.filter.api.AuthorizationResult
Represents the result of the authorization of a request.
- Since:
- 1.5.0
-
Method Summary
Modifier and TypeMethodDescriptionstatic AuthorizationResultaccessDenied(String reason) Creates a newAuthorizationResultinstance which indicates that access to the request protected resource is denied, for the given reason.static AuthorizationResultaccessDenied(String reason, JsonValue detail) Creates a newAuthorizationResultinstance which indicates that access to the request protected resource is denied, for the given reason and detail.static AuthorizationResultCreates a newAuthorizationResultinstance which indicates that access to the requested protected resource is allowed.Gets the detail of why the request is not authorized to access the requested resource.Gets the reason why the request is not authorized to access the requested resource.booleanWhether the request is authorized to access the requested resource.
-
Method Details
-
accessPermitted
Creates a newAuthorizationResultinstance which indicates that access to the requested protected resource is allowed.- Returns:
- A successful
AuthorizationResultinstance.
-
accessDenied
Creates a newAuthorizationResultinstance which indicates that access to the request protected resource is denied, for the given reason.- Parameters:
reason- The reason why authorization has failed.- Returns:
- A failed
AuthorizationResultinstance.
-
accessDenied
Creates a newAuthorizationResultinstance which indicates that access to the request protected resource is denied, for the given reason and detail.- Parameters:
reason- The reason why authorization failed.detail- AJsonValuecontaining additional detail on why authorization failed.- Returns:
- A failed
AuthorizationResultinstance.
-
isAuthorized
public boolean isAuthorized()Whether the request is authorized to access the requested resource.- Returns:
trueif the request is authorized.
-
getReason
Gets the reason why the request is not authorized to access the requested resource.- Returns:
- The reason why authorization failed.
nullif the request is authorized.
-
getDetail
Gets the detail of why the request is not authorized to access the requested resource.- Returns:
- A
JsonValuecontaining additional detail on why authorization failed. Maybenullwhen the request is unauthorized ornullif the request is authorized.
-