Spring Security Acegi 学习之路四
?
<bean id="filterChainProxy" value="anonymousUser"/> <!--匿名用户用户属性 --> <property name="userAttribute" value="ANONYMOUSUSER,PRIV_ANONYMOUS"/></bean><!--匿名用户认证提供者 --><bean id="anonymousAuthenticationProvider"value="anonymousUser"/></bean><bean id="authenticationManager"anonymousAuthenticationProvider" /> </list> </property></bean>??URL资源访问控制
<bean id="filterChainProxy" ref="authenticationManager"/><property name="asscessDecisionManager" ref=" asscessDecisionManager"/><property name="objectDefinitionSource"><value> CONVERT_URL_TO_LOWERCASE_BEFORE_COMPARISON PATTERN_TYPE_APACHE_ANT /login.jsp=PRIV_ANONYMOUS,PRIV_COMMON /hello_1.jsp=PRIV_1 /updateForum.jsp=PRIV_1</value></property></bean><!--HTTP请求访问决策管理器--><bean id="asscessDecisionManager" value="true"/><!--投票者列表-->< property name="decisionVoters"><list> <ref bean="roleVoter"/></list></property></bean><bean id="roleVoter" value="PRIV_"/></bean>?
?
<bean id="filterChainProxy" value="/error.jsp"/></bean></property></bean><bean id="authenticationEntryPoint" value="/index.jsp"/></bean>?
?
<bean id="methodSecurityInterceptor" ref="authenticationManager"/><property name="asscessDecisionManager" ref=" asscessDecisionManager"/><property name="objectDefinitionSource"><value>com.ccd.service.BbtForum.updateForum=PRIV_2</value></property></bean><bean id="bbtForum" value="true"/><property name="target" ref="bbtForumTarget"/></bean><bean id="bbtForumTarget"name="code">package com.ccd.service;import org.acegisecurity.annotation.Secured;import com.ccd.domain.Forum;public class BbtForum{@Secured({"PRIV_2"})//该业务方法对应的权限public void updateForum(Forum forum){System.out.println("execute update Forum…");}}
?
<bean id="methodSecurityInterceptor" ref="authenticationManager"/><property name="asscessDecisionManager" ref=" asscessDecisionManager"/><property name="objectDefinitionSource" ref="objectDefinitionSource"/></bean><!--根据Bean的注解元数据定义的对象定义源--><bean id="objectDefinitionSource" name="code"><bean name="code"><bean name="code"><bean class="MsoNormal">PS:本文主要摘自《精通Spring 2.x ——企业应用开发详解》