首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > J2EE开发 >

Spring3 security,该如何处理

2013-07-08 
Spring3 security问题一beans:bean idaccessDecisionManagerclassorg.springframework.security.acc

Spring3 security
问题一
<beans:bean id="accessDecisionManager"
class="org.springframework.security.access.vote.AffirmativeBased">
<beans:property name="allowIfAllAbstainDecisions" value="false" />
<beans:property name="decisionVoters">
<beans:list>
<beans:bean class="org.springframework.security.access.vote.RoleVoter" />
<beans:bean class="org.springframework.security.access.vote.AuthenticatedVoter" />
</beans:list>
</beans:property>
</beans:bean>
不明白AffirmativeBased 和 decisionVoters还有decisionVoters之间的关系

问题二
org.springframework.security.authenticationManager 和问题一中的AffirmativeBased 又有什么关系 还是没有关系 

谢谢高手帮忙
[解决办法]
认证(Authentication )被储存在一组GrantedAuthority中。
而GrantedAuthority被加入到AuthenticationManager里,然后被accessDecisionManager读取。

accessDecisionManager 有三种。
AffirmativeBased: 任意一个voter同意即可。
UnanimousBased:所有voter都同意才行。
ConsensusBased:需要多数voter同意。这个比例可以自己定义。

AffirmativeBased 拥有属性decisionVoters。在decisionVoters里定义都包含哪些voter

热点排行