|
@@ -1,138 +0,0 @@
|
|
-<?xml version="1.0" encoding="UTF-8"?>
|
|
|
|
-<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
|
|
|
|
-<!--
|
|
|
|
- * The Acegi Security System for Spring is published under the terms
|
|
|
|
- * of the Apache Software License.
|
|
|
|
- * $Id$
|
|
|
|
--->
|
|
|
|
-
|
|
|
|
-<beans>
|
|
|
|
-
|
|
|
|
- <!-- =================== SECURITY SYSTEM DEFINITIONS ================== -->
|
|
|
|
-
|
|
|
|
- <!-- RunAsManager -->
|
|
|
|
- <bean id="runAsManager" class="net.sf.acegisecurity.runas.RunAsManagerImpl">
|
|
|
|
- <property name="key"><value>my_run_as_password</value></property>
|
|
|
|
- </bean>
|
|
|
|
-
|
|
|
|
- <!-- ~~~~~~~~~~~~~~~~~~~~ AUTHENTICATION DEFINITIONS ~~~~~~~~~~~~~~~~~~ -->
|
|
|
|
-
|
|
|
|
- <!-- Data access object which stores authentication information -->
|
|
|
|
- <!-- The two invalid entries at the bottom are provided for testing purposes -->
|
|
|
|
- <bean id="inMemoryDaoImpl" class="net.sf.acegisecurity.providers.dao.memory.InMemoryDaoImpl">
|
|
|
|
- <property name="userMap">
|
|
|
|
- <value>
|
|
|
|
- marissa=koala,ROLE_TELLER,ROLE_SUPERVISOR
|
|
|
|
- dianne=emu,disabled,ROLE_TELLER
|
|
|
|
- scott=wombat,ACCOUNT_45
|
|
|
|
- peter=opal,ACCOUNT_77
|
|
|
|
- someone=password
|
|
|
|
- someoneelse=
|
|
|
|
- </value>
|
|
|
|
- </property>
|
|
|
|
- </bean>
|
|
|
|
-
|
|
|
|
- <!-- Authentication provider that queries our data access object -->
|
|
|
|
- <bean id="daoAuthenticationProvider" class="net.sf.acegisecurity.providers.dao.DaoAuthenticationProvider">
|
|
|
|
- <property name="authenticationDao"><ref bean="inMemoryDaoImpl"/></property>
|
|
|
|
- <property name="ignorePasswordCase"><value>false</value></property>
|
|
|
|
- <property name="ignoreUsernameCase"><value>true</value></property>
|
|
|
|
- </bean>
|
|
|
|
-
|
|
|
|
- <!-- Authentication provider that accepts as valid our RunAsManagerImpl created tokens -->
|
|
|
|
- <bean id="runAsAuthenticationProvider" class="net.sf.acegisecurity.runas.RunAsImplAuthenticationProvider">
|
|
|
|
- <property name="key"><value>my_run_as_password</value></property>
|
|
|
|
- </bean>
|
|
|
|
-
|
|
|
|
- <!-- The authentication manager that iterates through our authentication providers -->
|
|
|
|
- <bean id="authenticationManager" class="net.sf.acegisecurity.providers.ProviderManager">
|
|
|
|
- <property name="providers">
|
|
|
|
- <list>
|
|
|
|
- <ref bean="daoAuthenticationProvider"/>
|
|
|
|
- <ref bean="runAsAuthenticationProvider"/>
|
|
|
|
- </list>
|
|
|
|
- </property>
|
|
|
|
- </bean>
|
|
|
|
-
|
|
|
|
- <!-- ~~~~~~~~~~~~~~~~~~~~ AUTHORIZATION DEFINITIONS ~~~~~~~~~~~~~~~~~~~ -->
|
|
|
|
-
|
|
|
|
- <!-- An access decision voter that reads ROLE_* configuaration settings -->
|
|
|
|
- <bean id="roleVoter" class="net.sf.acegisecurity.vote.RoleVoter"/>
|
|
|
|
-
|
|
|
|
- <!-- An access decision voter that reads BANKSECURITY_CUSTOMER configuaration settings -->
|
|
|
|
- <bean id="bankSecurityVoter" class="net.sf.acegisecurity.BankSecurityVoter"/>
|
|
|
|
-
|
|
|
|
- <!-- An affirmative access decision manager -->
|
|
|
|
- <bean id="accessDecisionManager" class="net.sf.acegisecurity.vote.AffirmativeBased">
|
|
|
|
- <property name="allowIfAllAbstainDecisions"><value>false</value></property>
|
|
|
|
- <property name="decisionVoters">
|
|
|
|
- <list>
|
|
|
|
- <ref bean="roleVoter"/>
|
|
|
|
- <ref bean="bankSecurityVoter"/>
|
|
|
|
- </list>
|
|
|
|
- </property>
|
|
|
|
- </bean>
|
|
|
|
-
|
|
|
|
- <!-- ===================== SECURITY DEFINITIONS ======================= -->
|
|
|
|
-
|
|
|
|
- <!-- Note we don't specify to grant RUN_AS_SERVER to saveAccount invocations -->
|
|
|
|
- <bean id="publicBankManagerSecurity" class="net.sf.acegisecurity.SecurityInterceptor">
|
|
|
|
- <property name="authenticationManager"><ref bean="authenticationManager"/></property>
|
|
|
|
- <property name="accessDecisionManager"><ref bean="accessDecisionManager"/></property>
|
|
|
|
- <property name="runAsManager"><ref bean="runAsManager"/></property>
|
|
|
|
- <property name="methodDefinitionSource">
|
|
|
|
- <value>
|
|
|
|
- net.sf.acegisecurity.context.BankManager.delete*=ROLE_SUPERVISOR,RUN_AS_SERVER
|
|
|
|
- net.sf.acegisecurity.context.BankManager.getBalance=ROLE_TELLER,ROLE_SUPERVISOR,BANKSECURITY_CUSTOMER,RUN_AS_SERVER
|
|
|
|
- net.sf.acegisecurity.context.BankManager.loadAccount=ROLE_TELLER,ROLE_SUPERVISOR,BANKSECURITY_CUSTOMER,RUN_AS_SERVER
|
|
|
|
- net.sf.acegisecurity.context.BankManager.saveAccount=ROLE_TELLER,ROLE_SUPERVISOR
|
|
|
|
- net.sf.acegisecurity.context.BankManager.transferFunds=ROLE_SUPERVISOR,RUN_AS_SERVER
|
|
|
|
- </value>
|
|
|
|
- </property>
|
|
|
|
- </bean>
|
|
|
|
-
|
|
|
|
- <!-- We expect all callers of the backend object to hold the role ROLE_RUN_AS_SERVER -->
|
|
|
|
- <bean id="backendBankManagerSecurity" class="net.sf.acegisecurity.SecurityInterceptor">
|
|
|
|
- <property name="authenticationManager"><ref bean="authenticationManager"/></property>
|
|
|
|
- <property name="accessDecisionManager"><ref bean="accessDecisionManager"/></property>
|
|
|
|
- <property name="runAsManager"><ref bean="runAsManager"/></property>
|
|
|
|
- <property name="methodDefinitionSource">
|
|
|
|
- <value>
|
|
|
|
- net.sf.acegisecurity.context.BankManager.delete*=ROLE_RUN_AS_SERVER
|
|
|
|
- net.sf.acegisecurity.context.BankManager.getBalance=ROLE_RUN_AS_SERVER
|
|
|
|
- net.sf.acegisecurity.context.BankManager.loadAccount=ROLE_RUN_AS_SERVER
|
|
|
|
- net.sf.acegisecurity.context.BankManager.saveAccount=ROLE_RUN_AS_SERVER
|
|
|
|
- net.sf.acegisecurity.context.BankManager.transferFunds=ROLE_RUN_AS_SERVER
|
|
|
|
- </value>
|
|
|
|
- </property>
|
|
|
|
- </bean>
|
|
|
|
-
|
|
|
|
- <!-- ======================= BUSINESS DEFINITIONS ===================== -->
|
|
|
|
-
|
|
|
|
- <bean id="bankManager" class="org.springframework.aop.framework.ProxyFactoryBean">
|
|
|
|
- <property name="proxyInterfaces"><value>net.sf.acegisecurity.context.BankManager</value></property>
|
|
|
|
- <property name="interceptorNames">
|
|
|
|
- <list>
|
|
|
|
- <value>publicBankManagerSecurity</value>
|
|
|
|
- <value>publicBankManagerTarget</value>
|
|
|
|
- </list>
|
|
|
|
- </property>
|
|
|
|
- </bean>
|
|
|
|
-
|
|
|
|
- <bean id="publicBankManagerTarget" class="net.sf.acegisecurity.runas.BankManagerPublicFacade">
|
|
|
|
- <property name="backend"><ref bean="backendBankManager"/></property>
|
|
|
|
- </bean>
|
|
|
|
-
|
|
|
|
- <bean id="backendBankManager" class="org.springframework.aop.framework.ProxyFactoryBean">
|
|
|
|
- <property name="proxyInterfaces"><value>net.sf.acegisecurity.context.BankManager</value></property>
|
|
|
|
- <property name="interceptorNames">
|
|
|
|
- <list>
|
|
|
|
- <value>backendBankManagerSecurity</value>
|
|
|
|
- <value>backendBankManagerTarget</value>
|
|
|
|
- </list>
|
|
|
|
- </property>
|
|
|
|
- </bean>
|
|
|
|
-
|
|
|
|
- <bean id="backendBankManagerTarget" class="net.sf.acegisecurity.context.BankManagerImpl"/>
|
|
|
|
-
|
|
|
|
-</beans>
|
|
|