|
@@ -100,16 +100,16 @@ public final class AuthorizationAdvisorProxyFactory implements AuthorizationProx
|
|
|
|
|
|
/**
|
|
|
* Construct an {@link AuthorizationAdvisorProxyFactory} with the provided advisors.
|
|
|
- *
|
|
|
- * <p>
|
|
|
- * The list may be empty, in the case where advisors are added later using
|
|
|
- * {@link #addAdvisor}.
|
|
|
* @param advisors the advisors to use
|
|
|
* @since 6.4
|
|
|
*/
|
|
|
public AuthorizationAdvisorProxyFactory(List<AuthorizationAdvisor> advisors) {
|
|
|
this.advisors = new ArrayList<>(advisors);
|
|
|
- AnnotationAwareOrderComparator.sort(this.advisors);
|
|
|
+ for (AuthorizationAdvisor advisor : this.advisors) {
|
|
|
+ if (advisor instanceof AuthorizeReturnObjectMethodInterceptor interceptor) {
|
|
|
+ interceptor.setAuthorizationProxyFactory(this);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -124,8 +124,8 @@ public final class AuthorizationAdvisorProxyFactory implements AuthorizationProx
|
|
|
advisors.add(AuthorizationManagerAfterMethodInterceptor.postAuthorize());
|
|
|
advisors.add(new PreFilterAuthorizationMethodInterceptor());
|
|
|
advisors.add(new PostFilterAuthorizationMethodInterceptor());
|
|
|
+ advisors.add(new AuthorizeReturnObjectMethodInterceptor());
|
|
|
AuthorizationAdvisorProxyFactory proxyFactory = new AuthorizationAdvisorProxyFactory(advisors);
|
|
|
- proxyFactory.addAdvisor(new AuthorizeReturnObjectMethodInterceptor(proxyFactory));
|
|
|
AnnotationAwareOrderComparator.sort(proxyFactory.advisors);
|
|
|
return proxyFactory;
|
|
|
}
|
|
@@ -142,8 +142,8 @@ public final class AuthorizationAdvisorProxyFactory implements AuthorizationProx
|
|
|
advisors.add(AuthorizationManagerAfterReactiveMethodInterceptor.postAuthorize());
|
|
|
advisors.add(new PreFilterAuthorizationReactiveMethodInterceptor());
|
|
|
advisors.add(new PostFilterAuthorizationReactiveMethodInterceptor());
|
|
|
+ advisors.add(new AuthorizeReturnObjectMethodInterceptor());
|
|
|
AuthorizationAdvisorProxyFactory proxyFactory = new AuthorizationAdvisorProxyFactory(advisors);
|
|
|
- proxyFactory.addAdvisor(new AuthorizeReturnObjectMethodInterceptor(proxyFactory));
|
|
|
AnnotationAwareOrderComparator.sort(proxyFactory.advisors);
|
|
|
return proxyFactory;
|
|
|
}
|
|
@@ -230,7 +230,9 @@ public final class AuthorizationAdvisorProxyFactory implements AuthorizationProx
|
|
|
* them.
|
|
|
* @param advisor
|
|
|
* @since 6.4
|
|
|
+ * @deprecated please provide all advisors in the constructor
|
|
|
*/
|
|
|
+ @Deprecated
|
|
|
public void addAdvisor(AuthorizationAdvisor advisor) {
|
|
|
this.advisors.add(advisor);
|
|
|
}
|