读书人

spring3中增多 spring security控制权

发布时间: 2012-09-15 19:09:28 作者: rapoo

spring3中增加 spring security控制权限

在Spring3中增加security与 Spring2.5有些不同,主要是MethodSecurityInterceptor和FilterSecurityInterceptor中在SPING3中有改变导致,还有就是在SPING3中,类的位置有些调整,所以需要进行修正,详细见附件!

?

下面把spring-security的配置放在下面,供参考:

?

<bean id="methodSecurityInterceptor"
??/>
??</property>
??<!-- 自行定义那些方法需要什么权限访问 -->
??<property name="securityMetadataSource">
???<ref bean="databaseMethodDefinitionSource" />
??</property>
??<!-- 定义认证 -->
??<property name="authenticationManager">
???<ref bean="authenticationManager" />
??</property>
?</bean>

?<bean id="databaseMethodDefinitionSource"
??/>

?

?

?<bean id="filterSecurityInterceptor"
??ref="authenticationManager" />
??<property name="accessDecisionManager" ref="accessDecisionManager" />
??<!-- 获取访问被访问的资源所需要的权限(authority) -->
??<property name="securityMetadataSource" ref="UrlFilterSecurityMetadataSource" />
?</bean>

?<bean id="UrlFilterSecurityMetadataSource"
??class="com.cigna.cmc.spring.security.UrlFilterSecurityMetadataSource">
?</bean>

读书人网 >软件架构设计

热点推荐