From 9766ee1cbee71348f2c0c5a8d8186fce818c992e Mon Sep 17 00:00:00 2001 From: Ben Alex Date: Thu, 26 Jan 2006 10:12:09 +0000 Subject: [PATCH] SEC-151: Add comment about BeanNameAutoProxyCreator. --- doc/docbook/acegi.xml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/doc/docbook/acegi.xml b/doc/docbook/acegi.xml index 1ff162fed9..f1d01bf159 100644 --- a/doc/docbook/acegi.xml +++ b/doc/docbook/acegi.xml @@ -743,6 +743,26 @@ public interface BankManager { Jakarta Commons Attributes method of configuration, you should set validateConfigAttributes to false. + + Please note that when using + BeanNameAutoProxyCreator to create the required + proxy for security, the configuration must contain the property + proxyTargetClass set to true. + Otherwise, the method passed to + MethodSecurityInterceptor.invoke is the proxy's + caller, not the proxy's target. Note that this introduces a + requirement on CGLIB. See an example of using + BeanNameAutoProxyCreator below: + + <bean id="autoProxyCreator" class="org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator"> + <property name="interceptorNames"> + <list><value>methodSecurityInterceptor</value></list> + </property> + <property name="beanNames"> + <list><value>targetObjectName</value></list> + </property> + <property name="proxyTargetClass" value="true"/> +</bean>