title: Spring security AccessDecisionManager: roleVoter, Acl Voter
body: <p>I'm trying to setup a Spring Security 3.2 project using Java Config and no XML at all.
  I want to have an Access decision voter that supports both RoleHierarchyVoter and AclEntryVoters. This is the configuration I'm using:</p>
  
  <pre><code>@Configuration
  @EnableWebSecurity
  public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
          @Autowired
          private AclEntryVoter aclUpdatePropertyVoter;
  
          @Autowired
          private AclEntryVoter aclDeletePropertyVoter;
  
          @Override
          protected void configure(HttpSecurity http) throws Exception {
                  http
                          .formLogin()
                          .and()
                          .logout()
                              .deleteCookies("JSESSIONID")
                              .logoutSuccessUrl("/")
                          .and()
                          .authorizeRequests()
                                   .accessDecisionManager(accessDecisionManager()) 
                                  .antMatchers("/login", "/signup/email", "/logout",                 "/search", "/").permitAll()
                                  .anyRequest().authenticated();
  
  }
  
  
  @Bean
  public RoleHierarchyVoter roleVoter() {
          RoleHierarchyImpl roleHierarchy = new RoleHierarchyImpl();
          roleHierarchy.setHierarchy("ROLE_USER &gt; ROLE_ANONYMOUS");
          RoleHierarchyVoter roleHierarchyVoter = new RoleHierarchyVoter(roleHierarchy);
          return roleHierarchyVoter;
  }
  
  @Bean
  public AffirmativeBased accessDecisionManager() {
          List&lt;AccessDecisionVoter&gt; decisionVoters = new ArrayList&lt;&gt;();
          WebExpressionVoter webExpressionVoter = new WebExpressionVoter();
          decisionVoters.add(webExpressionVoter);
          decisionVoters.add(roleVoter());
          decisionVoters.add(aclDeletePropertyVoter);
          decisionVoters.add(aclUpdatePropertyVoter);
  
          AffirmativeBased affirmativeBased = new AffirmativeBased(decisionVoters);
          return affirmativeBased;
  }
  
  
  
  }
  </code></pre>
  
  <p>However, when the app gets initialized I get the following exception:</p>
  
  <p>I get the exception:</p>
  
  <pre><code>java.lang.IllegalArgumentException: AccessDecisionManager does not support secure object class: class org.springframework.security.web.FilterInvocation
  </code></pre>
  
  <p>When debugging the code I can see that when AbstractAccessDecisionManager is called and the following code is executed:</p>
  
  <pre><code>public boolean supports(Class&lt;?&gt; clazz) {
      for (AccessDecisionVoter voter : this.decisionVoters) {
          if (!voter.supports(clazz)) {
              return false;
          }
      }
  
      return true;
  }
  </code></pre>
  
  <p>RoleHierarchyVoter support FilterInvocation, however AclEntryVoters fail to pass it. What I'm doing wrong in the configuration? How can I set the project so that it supports both types of voters? Thanks a lot in advance </p>