mirror of
https://github.com/spring-projects/spring-security.git
synced 2025-07-04 09:42:29 +00:00
Skip Proxying If Already Proxied
Issue gh-15709
This commit is contained in:
parent
6f5e103dec
commit
d194724a04
@ -169,6 +169,9 @@ public final class AuthorizationAdvisorProxyFactory
|
|||||||
if (target == null) {
|
if (target == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
if (target instanceof AuthorizationProxy proxied) {
|
||||||
|
return proxied;
|
||||||
|
}
|
||||||
Object proxied = this.visitor.visit(this, target);
|
Object proxied = this.visitor.visit(this, target);
|
||||||
if (proxied != null) {
|
if (proxied != null) {
|
||||||
return proxied;
|
return proxied;
|
||||||
@ -365,6 +368,9 @@ public final class AuthorizationAdvisorProxyFactory
|
|||||||
@Override
|
@Override
|
||||||
public Object visit(AuthorizationAdvisorProxyFactory proxyFactory, Object object) {
|
public Object visit(AuthorizationAdvisorProxyFactory proxyFactory, Object object) {
|
||||||
if (object instanceof Class<?> targetClass) {
|
if (object instanceof Class<?> targetClass) {
|
||||||
|
if (AuthorizationProxy.class.isAssignableFrom(targetClass)) {
|
||||||
|
return targetClass;
|
||||||
|
}
|
||||||
ProxyFactory factory = new ProxyFactory();
|
ProxyFactory factory = new ProxyFactory();
|
||||||
factory.setTargetClass(targetClass);
|
factory.setTargetClass(targetClass);
|
||||||
factory.setInterfaces(ClassUtils.getAllInterfacesForClass(targetClass));
|
factory.setInterfaces(ClassUtils.getAllInterfacesForClass(targetClass));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user