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

Brian Stansberry (JIRA) issues at jboss.org
Mon Oct 26 10:21:00 EDT 2015


     [ https://issues.jboss.org/browse/WFCORE-1068?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Brian Stansberry updated WFCORE-1068:
-------------------------------------
    Priority: Optional  (was: Major)


> 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
>            Priority: Optional
>
> 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