Examples of AuthorisationDecision


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

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

        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

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

    @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

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

            this.constraints = constraints;
        }

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

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

            return getReadPriviledge();
        }

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

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

        @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

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

        }

        @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

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

        String token = placemanager.getCurrentPlaceRequest().getNameToken();

        if (securityFramework.hasContext(token)) {
            try {
                SecurityContext securityContext = securityFramework.getSecurityContext(token);
                final AuthorisationDecision readPrivilege = securityContext.getReadPriviledge();

                // bootstrap operations
                boolean bootstrapRequirementsSatisfied = true;
                for (String op : accessControlMetaData.getOperations(token)) {
                    int idx = op.indexOf("#");
                    AuthorisationDecision opPrivilege = securityContext.getOperationPriviledge(
                            op.substring(0, idx),
                            op.substring(idx + 1, op.length())
                    );

                    if (!opPrivilege.isGranted()) {
                        bootstrapRequirementsSatisfied = false;
                        break;
                    }
                }
                outcome = readPrivilege.isGranted() && bootstrapRequirementsSatisfied;
View Full Code Here

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

    private AuthorisationDecision checkPriviledge(Priviledge p, boolean includeOptional) {

        if(!sealed)
            throw new RuntimeException("Should be sealed before policy decisions are evaluated");

        AuthorisationDecision decision = new AuthorisationDecision(true);
        for(ResourceRef ref : requiredResources)
        {
            if(ref.optional) continue; // skip optional ones

            final Constraints model = getConstraints(ref.address, includeOptional);
            if(model!=null)
            {
                if(!p.isGranted(model))
                {
                    decision.getErrorMessages().add(ref.address);
                }
            }
            else
            {
                decision.getErrorMessages().add("Missing constraints for "+ ref.address);
            }

            if(decision.hasErrorMessages())
            {
                decision.setGranted(false);
                break;
            }
        }

        return decision;
View Full Code Here

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

    }

    @Override
    public AuthorisationDecision getReadPrivilege(String resourceAddress) {
        Constraints constraints = getConstraints(resourceAddress, false);
        return new AuthorisationDecision(constraints.isReadResource());
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.