Package org.jboss.ballroom.client.rbac

Examples of org.jboss.ballroom.client.rbac.AuthorisationDecision


    }

    @Override
    public AuthorisationDecision getWritePrivilege(String resourceAddress) {
        Constraints constraints = getConstraints(resourceAddress, false);
        return new AuthorisationDecision(constraints.isWriteResource());
    }
View Full Code Here


        Constraints.AttributePerm attributePerm = constraints.attributePermissions.get(attributeName);

        if(null==attributePerm)
            throw new RuntimeException("No such attribute: "+ attributeName);

        return new AuthorisationDecision(attributePerm.isWrite());
    }
View Full Code Here

    @Override
    public AuthorisationDecision getOperationPriviledge(final String resourceAddress, final String operationName) {

        Constraints constraints = getConstraints(resourceAddress, true);
        boolean execPerm = constraints.isOperationExec(resourceAddress, operationName);
        AuthorisationDecision descision = new AuthorisationDecision(true);
        descision.setGranted(execPerm);
        return descision;
    }
View Full Code Here

            this.constraints = constraints;
        }

        @Override
        public AuthorisationDecision getReadPriviledge() {
            return new AuthorisationDecision(constraints.isReadResource());
        }
View Full Code Here

            return getReadPriviledge();
        }

        @Override
        public AuthorisationDecision getWritePriviledge() {
            return new AuthorisationDecision(constraints.isWriteResource());
        }
View Full Code Here

        @Override
        public AuthorisationDecision getAttributeWritePriviledge(final String attributeName) {
            Constraints.AttributePerm attributePerm = constraints.attributePermissions.get(attributeName);
            if (attributePerm == null) { throw new RuntimeException("No such attribute: " + attributeName); }
            return new AuthorisationDecision(attributePerm.isWrite());
        }
View Full Code Here

        }

        @Override
        public AuthorisationDecision getOperationPriviledge(final String resourceAddress, final String operationName) {
            boolean execPerm = constraints.isOperationExec(this.resourceAddress, operationName);
            AuthorisationDecision descision = new AuthorisationDecision(true);
            descision.setGranted(execPerm);
            return descision;
        }
View Full Code Here

        appendHtmlConstant("</div>");
        return this;
    }

    HtmlGenerator startLinks(final SecurityContext securityContext, boolean groupLinks) {
        AuthorisationDecision decision;
        if (groupLinks) {
            decision = securityContext.getOperationPriviledge("/server-group=*", "start-servers");
        } else {
            decision = securityContext.getOperationPriviledge("/{selected.host}/server-config=*", "start");
        }

        if (decision.isGranted()) {
            appendHtmlConstant("<div>");
        } else {
            appendHtmlConstant("<div class='rbac-suppressed'>");
        }

View Full Code Here

TOP

Related Classes of org.jboss.ballroom.client.rbac.AuthorisationDecision

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.