Examples of AffirmativeBased


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

    }

    @Marker( SpringSecurityServices.class )
    public final AccessDecisionManager buildAccessDecisionManager( final List<AccessDecisionVoter> voters )
            throws Exception {
        final AffirmativeBased manager = new AffirmativeBased(voters);
        manager.afterPropertiesSet();
        return manager;
    }
View Full Code Here

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

    }

    @Marker( SpringSecurityServices.class )
    public final AccessDecisionManager buildAccessDecisionManager( final List<AccessDecisionVoter> voters )
            throws Exception {
        final AffirmativeBased manager = new AffirmativeBased(voters);
        manager.afterPropertiesSet();
        return manager;
    }
View Full Code Here

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

    /**
     * Creates the default {@code AccessDecisionManager}
     * @return the default {@code AccessDecisionManager}
     */
    private AccessDecisionManager createDefaultAccessDecisionManager(H http) {
        return new AffirmativeBased(getDecisionVoters(http));
    }
View Full Code Here

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

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

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

    @Bean
    public ChannelSecurityInterceptor inboundChannelSecurity() {
        ChannelSecurityInterceptor channelSecurityInterceptor = new ChannelSecurityInterceptor(inboundMessageSecurityMetadataSource());
        List<AccessDecisionVoter> voters = new ArrayList<AccessDecisionVoter>();
        voters.add(new MessageExpressionVoter());
        AffirmativeBased manager = new AffirmativeBased(voters);
        channelSecurityInterceptor.setAccessDecisionManager(manager);
        return channelSecurityInterceptor;
    }
View Full Code Here

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

    @Before
    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);
View Full Code Here

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

    @SuppressWarnings("unchecked")
    @Test
    public void expressionVoterAndAfterInvocationProviderUseSameExpressionHandlerInstance() throws Exception {
        setContext("<global-method-security pre-post-annotations='enabled'/>" + AUTH_PROVIDER_XML);
        AffirmativeBased adm = (AffirmativeBased) appContext.getBeansOfType(AffirmativeBased.class).values().toArray()[0];
        List voters = (List) FieldUtils.getFieldValue(adm, "decisionVoters");
        PreInvocationAuthorizationAdviceVoter mev = (PreInvocationAuthorizationAdviceVoter) voters.get(0);
        MethodSecurityMetadataSourceAdvisor msi = (MethodSecurityMetadataSourceAdvisor)
            appContext.getBeansOfType(MethodSecurityMetadataSourceAdvisor.class).values().toArray()[0];
        AfterInvocationProviderManager pm = (AfterInvocationProviderManager) ((MethodSecurityInterceptor)msi.getAdvice()).getAfterInvocationManager();
View Full Code Here

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

        @SuppressWarnings("rawtypes")
        @Override
        protected void configure(HttpSecurity http) throws Exception {
            SecurityExpressionHandler<FilterInvocation> handler = new DefaultWebSecurityExpressionHandler();
            WebExpressionVoter expressionVoter = new WebExpressionVoter();
            AffirmativeBased adm = new AffirmativeBased(Arrays.<AccessDecisionVoter>asList(expressionVoter));
            http
                .authorizeRequests()
                    .expressionHandler(handler)
                    .accessDecisionManager(adm)
                    .filterSecurityInterceptorOncePerRequest(true)
View Full Code Here

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

    } 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 {
        throw new IllegalStateException("Unknown SecurityRule match type: " + rule.getComparisonType());
      }
View Full Code Here

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

        decisionVoters.add(new PreInvocationAuthorizationAdviceVoter(
                expressionAdvice));
        decisionVoters.add(new RoleVoter());
        decisionVoters.add(new AuthenticatedVoter());
        return new AffirmativeBased(decisionVoters);
    }
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.