Skip to content

Instantly share code, notes, and snippets.

@maggandalf
Created April 15, 2011 16:12
Show Gist options
  • Save maggandalf/921965 to your computer and use it in GitHub Desktop.
Save maggandalf/921965 to your computer and use it in GitHub Desktop.
Configuring Custom Voter In Access Decision Manager.
<security:http auto-config="true" access-decision-manager-ref="accessDecision">
<security:intercept-url pattern="/**" access="ROLE_USER"/>
</security:http>
<bean id="accessDecision" class="org.springframework.security.access.vote.AffirmativeBased">
<property name="decisionVoters">
<set>
<bean class="org.springframework.security.access.vote.RoleVoter"></bean>
<bean class="org.example.security.voter.NightVoter"></bean>
</set>
</property>
</bean>
<bean id="org.springframework.security.authenticationManager" class="org.springframework.security.authentication.ProviderManager">
<property name="providers">
<set>
<ref local="daoProvider"/>
</set>
</property>
</bean>
<bean id="daoProvider" class="org.springframework.security.authentication.dao.DaoAuthenticationProvider">
<property name="userDetailsService" ref="inMemory"></property>
</bean>
<security:user-service id="inMemory">
<security:user name="jimi" password="jimi" authorities="ROLE_USER"/>
</security:user-service>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment