Package org.jboss.as.controller.access
Class AuthorizationResult
java.lang.Object
org.jboss.as.controller.access.AuthorizationResult
The result of an access control decision.
- Author:
- Brian Stansberry (c) 2013 Red Hat Inc.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCreates an authorization result with no explanation.AuthorizationResult(AuthorizationResult.Decision decision, org.jboss.dmr.ModelNode explanation) Creates an authorization result with an optional explanation. -
Method Summary
Modifier and TypeMethodDescriptionvoidfailIfDenied(org.jboss.dmr.ModelNode operation) Utility method to throw a standard failure ifgetDecision()isAuthorizationResult.Decision.DENY.voidfailIfDenied(org.jboss.dmr.ModelNode operation, PathAddress targetAddress) Utility method to throw a standard failure ifgetDecision()isAuthorizationResult.Decision.DENY.Gets the authorization decision.org.jboss.dmr.ModelNodeGets the explanation for the authorization decision.
-
Field Details
-
PERMITTED
-
-
Constructor Details
-
AuthorizationResult
Creates an authorization result with no explanation.- Parameters:
decision- the authorization decision. Cannot benull
-
AuthorizationResult
public AuthorizationResult(AuthorizationResult.Decision decision, org.jboss.dmr.ModelNode explanation) Creates an authorization result with an optional explanation.- Parameters:
decision- the authorization decision. Cannot benullexplanation- the explanation for the decision. May benull
-
-
Method Details
-
getDecision
Gets the authorization decision.- Returns:
- the decision. Will not be
null
-
getExplanation
public org.jboss.dmr.ModelNode getExplanation()Gets the explanation for the authorization decision. Will be an undefined node if no explanation was passed to the constructor.- Returns:
- the explanation, an immutable model node. Will not be
null, but may be an undefined node
-
failIfDenied
Utility method to throw a standard failure ifgetDecision()isAuthorizationResult.Decision.DENY.This variant extracts the target address from the
addressfield in theoperationparam and then calls the overloaded variant.- Parameters:
operation- the operation the triggered this authorization result. Cannot benull- Throws:
OperationFailedException- ifgetDecision()isAuthorizationResult.Decision.DENY
-
failIfDenied
public void failIfDenied(org.jboss.dmr.ModelNode operation, PathAddress targetAddress) throws OperationFailedException Utility method to throw a standard failure ifgetDecision()isAuthorizationResult.Decision.DENY.- Parameters:
operation- the operation the triggered this authorization result. Cannot benulltargetAddress- the target address of the request that triggered this authorization result. Cannot benull- Throws:
OperationFailedException- ifgetDecision()isAuthorizationResult.Decision.DENY
-