SEC-1768: Use AopProxyUtils.ultimateTargetClass() to cater for the situation where the security interceptor is being applied to a proxy.

This commit is contained in:
Luke Taylor 2011-06-18 14:35:56 +01:00
parent 5a1ddc660b
commit d253f5e109
1 changed files with 2 additions and 1 deletions

View File

@ -20,6 +20,7 @@ import java.util.Collection;
import org.aopalliance.intercept.MethodInvocation;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.aop.framework.AopProxyUtils;
import org.springframework.security.access.ConfigAttribute;
@ -43,7 +44,7 @@ public abstract class AbstractMethodSecurityMetadataSource implements MethodSecu
Class<?> targetClass = null;
if (target != null) {
targetClass = target instanceof Class<?> ? (Class<?>)target : target.getClass();
targetClass = target instanceof Class<?> ? (Class<?>)target : AopProxyUtils.ultimateTargetClass(target);
}
return getAttributes(mi.getMethod(), targetClass);