Package org.springframework.security.access.vote

Examples of org.springframework.security.access.vote.RoleVoter


        manager.afterPropertiesSet();
        return manager;
    }

    public final void contributeAccessDecisionManager( final OrderedConfiguration<AccessDecisionVoter> configuration ) {
        configuration.add( "RoleVoter", new RoleVoter() );
    }
View Full Code Here


        manager.afterPropertiesSet();
        return manager;
    }

    public final void contributeAccessDecisionManager( final OrderedConfiguration<AccessDecisionVoter> configuration ) {
        configuration.add( "RoleVoter", new RoleVoter() );
    }
View Full Code Here

     */
    @Override
    @SuppressWarnings("rawtypes")
    final List<AccessDecisionVoter> getDecisionVoters(H http) {
        List<AccessDecisionVoter> decisionVoters = new ArrayList<AccessDecisionVoter>();
        decisionVoters.add(new RoleVoter());
        decisionVoters.add(new AuthenticatedVoter());
        return decisionVoters;
    }
View Full Code Here

                expressionAdvice));
        }
        if(jsr250Enabled()) {
            decisionVoters.add(new Jsr250Voter());
        }
        decisionVoters.add(new RoleVoter());
        decisionVoters.add(new AuthenticatedVoter());
        return new AffirmativeBased(decisionVoters);
    }
View Full Code Here

    public final void setUp() throws Exception {
        MockitoAnnotations.initMocks(this);
        interceptor = new AspectJMethodSecurityInterceptor();
        adm = new AffirmativeBased();
        AccessDecisionVoter[] voters = new AccessDecisionVoter[]
                {new RoleVoter(), new PreInvocationAuthorizationAdviceVoter(new ExpressionBasedPreInvocationAdvice())};
        adm.setDecisionVoters(Arrays.asList(voters));
        interceptor.setAccessDecisionManager(adm);
        interceptor.setAuthenticationManager(authman);
        interceptor.setSecurityMetadataSource(new SecuredAnnotationSecurityMetadataSource());
        AnnotationSecurityAspect secAspect = AnnotationSecurityAspect.aspectOf();
View Full Code Here

            assertTrue(true);
        }
    }

    public void testRoleVoterAlwaysReturnsTrueToSupports() {
        RoleVoter rv = new RoleVoter();
        assertTrue(rv.supports(String.class));
    }
View Full Code Here

    //~ Methods ========================================================================================================

    private UnanimousBased makeDecisionManager() {
        UnanimousBased decisionManager = new UnanimousBased();
        RoleVoter roleVoter = new RoleVoter();
        DenyVoter denyForSureVoter = new DenyVoter();
        DenyAgainVoter denyAgainForSureVoter = new DenyAgainVoter();
        List<AccessDecisionVoter> voters = new Vector<AccessDecisionVoter>();
        voters.add(roleVoter);
        voters.add(denyForSureVoter);
View Full Code Here

        return decisionManager;
    }

    private UnanimousBased makeDecisionManagerWithFooBarPrefix() {
        UnanimousBased decisionManager = new UnanimousBased();
        RoleVoter roleVoter = new RoleVoter();
        roleVoter.setRolePrefix("FOOBAR_");

        DenyVoter denyForSureVoter = new DenyVoter();
        DenyAgainVoter denyAgainForSureVoter = new DenyAgainVoter();
        List<AccessDecisionVoter> voters = new Vector<AccessDecisionVoter>();
        voters.add(roleVoter);
View Full Code Here

    if (accessDecisionManager != null) {
      accessDecisionManager.decide(authentication, object, configAttributes);
    } else {
      AbstractAccessDecisionManager abstractAccessDecisionManager;
      List<AccessDecisionVoter> voters = new ArrayList<AccessDecisionVoter>();
      voters.add(new RoleVoter());
      if (rule.getComparisonType() == SecurityRule.COMPARISON_ANY) {
        abstractAccessDecisionManager = new AffirmativeBased();
      } else if (rule.getComparisonType() == SecurityRule.COMPARISON_ALL) {
        abstractAccessDecisionManager = new UnanimousBased();
      } else {
View Full Code Here

    }

    @Bean
    public AccessDecisionManager shellAccessDecisionManager() {
      List<AccessDecisionVoter> voters = new ArrayList<AccessDecisionVoter>();
      RoleVoter voter = new RoleVoter();
      voter.setRolePrefix("");
      voters.add(voter);
      AccessDecisionManager result = new UnanimousBased(voters);
      return result;
    }
View Full Code Here

TOP

Related Classes of org.springframework.security.access.vote.RoleVoter

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.