public class AuthorizationResult extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
AuthorizationResult.Decision |
| Modifier and Type | Field and Description |
|---|---|
static AuthorizationResult |
PERMITTED |
| Constructor and Description |
|---|
AuthorizationResult(AuthorizationResult.Decision decision)
Creates an authorization result with no explanation.
|
AuthorizationResult(AuthorizationResult.Decision decision,
org.jboss.dmr.ModelNode explanation)
Creates an authorization result with an optional explanation.
|
| Modifier and Type | Method and Description |
|---|---|
void |
failIfDenied(org.jboss.dmr.ModelNode operation)
Utility method to throw a standard failure if
getDecision() is
AuthorizationResult.Decision.DENY. |
void |
failIfDenied(org.jboss.dmr.ModelNode operation,
PathAddress targetAddress)
Utility method to throw a standard failure if
getDecision() is
AuthorizationResult.Decision.DENY. |
AuthorizationResult.Decision |
getDecision()
Gets the authorization decision.
|
org.jboss.dmr.ModelNode |
getExplanation()
Gets the explanation for the authorization decision.
|
public static final AuthorizationResult PERMITTED
public AuthorizationResult(AuthorizationResult.Decision decision)
decision - the authorization decision. Cannot be nullpublic AuthorizationResult(AuthorizationResult.Decision decision, org.jboss.dmr.ModelNode explanation)
decision - the authorization decision. Cannot be nullexplanation - the explanation for the decision. May be nullpublic AuthorizationResult.Decision getDecision()
nullpublic org.jboss.dmr.ModelNode getExplanation()
null, but may be an undefined nodepublic void failIfDenied(org.jboss.dmr.ModelNode operation)
throws OperationFailedException
getDecision() is
AuthorizationResult.Decision.DENY.
This variant extracts the target address from the address field in the operation param
and then calls the overloaded variant.
operation - the operation the triggered this authorization result. Cannot be nullOperationFailedException - if getDecision() is
AuthorizationResult.Decision.DENYpublic void failIfDenied(org.jboss.dmr.ModelNode operation,
PathAddress targetAddress)
throws OperationFailedException
getDecision() is
AuthorizationResult.Decision.DENY.operation - the operation the triggered this authorization result. Cannot be nulltargetAddress - the target address of the request that triggered this authorization result. Cannot be nullOperationFailedException - if getDecision() is
AuthorizationResult.Decision.DENYCopyright © 2019 JBoss by Red Hat. All rights reserved.