Package org.uberfire.security.authz

Examples of org.uberfire.security.authz.VotingStrategy


        final AuthenticationScheme authScheme = getAuthenticationScheme( options );
        final AuthenticationManager authManager = getAuthenticationManager( options );
        final AuthenticationProvider authProvider = getAuthenticationProvider( options );
        final ResourceManager resourceManager = getResourceManager( options );
        final AuthorizationManager authzManager = getAuthorizationManager( options );
        final VotingStrategy urlVotingStrategy = getURLVotingStrategy( options );
        final ResourceDecisionManager accessDecisionManager = getURLAccessDecisionManager( options );
        final RoleDecisionManager roleDecisionManager = getRoleDecisionManager( options );
        final RoleProvider roleProvider = getRoleProvider( options );
        final SubjectPropertiesProvider propertiesProvider = getPropertiesProvider( options );
View Full Code Here


            if (restriction == null || restriction.isEmpty()) {
                return ACCESS_ABSTAIN;
            }

            boolean invertResult = false;
            VotingStrategy votingStrategy = null;

            for (final String trait : restriction.getTraits()) {
                if (trait.equals(All.class.getName())) {
                    votingStrategy = ALL_VOTER;
                } else if (trait.equals(Authorized.class.getName())) {
                    if (subject != null) {
                        return ACCESS_GRANTED;
                    }
                } else if (trait.equals(Deny.class.getName())) {
                    invertResult = true;
                }
            }

            if (votingStrategy == null) {
                votingStrategy = DEFAULT_VOTER;
            }

            final RolesResource rolesResource = new RolesResource() {
                @Override
                public Collection<Role> getRoles() {
                    return restriction.getRoles();
                }
            };

            final AuthorizationResult result = votingStrategy.vote(roleDecisionManager.decide(rolesResource, subject));

            if (invertResult) {
                cache.put(subject, runtimeResource, result.invert());
            } else {
                cache.put(subject, runtimeResource, result);
View Full Code Here

TOP

Related Classes of org.uberfire.security.authz.VotingStrategy

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.