views:

189

answers:

1

Can two MethodSecurityInterceptor beans be defined as follows?

<beans>
   <bean id="moduleOneMethodSecurity" 
     class="org.acegisecurity.intercept.method.aopalliance.MethodSecurityInterceptor">
        <property name="accessDecisionManager"><ref bean="serviceAccessDecisionManager"/></property>
        <property name="authenticationManager"><ref bean="authenticationManager"/></property>
        <property name="objectDefinitionSource">
            <value>
            modules.first.MyObject.*=ROLE_MINE
            </value>
        </property>
    </bean>

        <bean id="moduleTwoMethodSecurity" 
         class="org.acegisecurity.intercept.method.aopalliance.MethodSecurityInterceptor">
            <property name="accessDecisionManager"><ref bean="serviceAccessDecisionManager"/></property>
            <property name="authenticationManager"><ref bean="authenticationManager"/></property>
            <property name="objectDefinitionSource">
                <value>
                modules.second.YourObject.*=ROLE_YOURS
                </value>
            </property>
        </bean>
    </beans>

The reason for doing this would be to separate the bean definition for each module into separate XML files.

A: 

I guess Its fine

joe