[jboss-jira] [JBoss JIRA] (WFCORE-1068) Simplify failing in the case of RBAC AuthorizationResult.Decision.DENY

Brian Stansberry (JIRA) issues at jboss.org
Wed Oct 21 08:29:00 EDT 2015


Brian Stansberry created WFCORE-1068:
----------------------------------------

             Summary: Simplify failing in the case of RBAC AuthorizationResult.Decision.DENY
                 Key: WFCORE-1068
                 URL: https://issues.jboss.org/browse/WFCORE-1068
             Project: WildFly Core
          Issue Type: Enhancement
          Components: Domain Management
            Reporter: Brian Stansberry
            Assignee: Brian Stansberry


There's a fair amount of this kind of code in misc OSHs that directly ask the OperationContext to authorize something:

{code}
AuthorizationResult authorizationResult = context.authorize(...);
if (authorizationResult.getDecision() == AuthorizationResult.Decision.DENY) {
    throw ControllerMessages.MESSAGES.unauthorized(operation.get(OP).asString(),
                            context.getCurrentAddress()), authorizationResult.getExplanation());
}
{code}

We can replace that if block with a call to a new util method on AuthorizationResult itself:

{code}
public void failIfDenied(ModelNode operation, PathAddress pathAddress) throws OperationFailedException
{code}



--
This message was sent by Atlassian JIRA
(v6.4.11#64026)


More information about the jboss-jira mailing list