- Changed from MethodMatcher to Pointcut since authorization
annotations also can be attached to classes
- Adjusted advice to extend Before or AfterAdvice
- Adjusted advice to extend PointcutAdvisor so
that it can share its Pointcut
- Adjusted advice to extend AopInfrastructureBean to
align with old advice classes
Issue gh-9289
@ -92,7 +88,9 @@ final class MethodSecurityConfiguration implements ImportAware, InitializingBean
@@ -92,7 +88,9 @@ final class MethodSecurityConfiguration implements ImportAware, InitializingBean
@ -147,32 +145,34 @@ final class MethodSecurityConfiguration implements ImportAware, InitializingBean
@@ -147,32 +145,34 @@ final class MethodSecurityConfiguration implements ImportAware, InitializingBean
@ -196,16 +196,18 @@ final class MethodSecurityConfiguration implements ImportAware, InitializingBean
@@ -196,16 +196,18 @@ final class MethodSecurityConfiguration implements ImportAware, InitializingBean
@ -241,27 +243,9 @@ final class MethodSecurityConfiguration implements ImportAware, InitializingBean
@@ -241,27 +243,9 @@ final class MethodSecurityConfiguration implements ImportAware, InitializingBean
Assert.notNull(pointcut,"pointcut cannot be null");
Assert.notNull(authorizationManager,"authorizationManager cannot be null");
this.methodMatcher=methodMatcher;
this.pointcut=pointcut;
this.authorizationManager=authorizationManager;
}
@ -65,9 +66,12 @@ public final class AuthorizationManagerMethodAfterAdvice<T> implements Authoriza
@@ -65,9 +66,12 @@ public final class AuthorizationManagerMethodAfterAdvice<T> implements Authoriza
Assert.notNull(pointcut,"pointcut cannot be null");
Assert.notNull(authorizationManager,"authorizationManager cannot be null");
this.methodMatcher=methodMatcher;
this.pointcut=pointcut;
this.authorizationManager=authorizationManager;
}
@ -64,9 +65,12 @@ public final class AuthorizationManagerMethodBeforeAdvice<T> implements Authoriz
@@ -64,9 +65,12 @@ public final class AuthorizationManagerMethodBeforeAdvice<T> implements Authoriz
@ -42,18 +43,7 @@ public final class DelegatingAuthorizationMethodAfterAdvice
@@ -42,18 +43,7 @@ public final class DelegatingAuthorizationMethodAfterAdvice
@ -63,12 +53,26 @@ public final class DelegatingAuthorizationMethodAfterAdvice
@@ -63,12 +53,26 @@ public final class DelegatingAuthorizationMethodAfterAdvice
@ -42,18 +43,7 @@ public final class DelegatingAuthorizationMethodBeforeAdvice
@@ -42,18 +43,7 @@ public final class DelegatingAuthorizationMethodBeforeAdvice
@ -63,12 +53,26 @@ public final class DelegatingAuthorizationMethodBeforeAdvice
@@ -63,12 +53,26 @@ public final class DelegatingAuthorizationMethodBeforeAdvice
@ -47,16 +47,19 @@ public final class PostFilterAuthorizationMethodAfterAdvice
@@ -47,16 +47,19 @@ public final class PostFilterAuthorizationMethodAfterAdvice
@ -66,9 +69,12 @@ public final class PostFilterAuthorizationMethodAfterAdvice
@@ -66,9 +69,12 @@ public final class PostFilterAuthorizationMethodAfterAdvice
@ -47,16 +47,19 @@ public final class PreFilterAuthorizationMethodBeforeAdvice
@@ -47,16 +47,19 @@ public final class PreFilterAuthorizationMethodBeforeAdvice
@ -66,9 +69,12 @@ public final class PreFilterAuthorizationMethodBeforeAdvice
@@ -66,9 +69,12 @@ public final class PreFilterAuthorizationMethodBeforeAdvice
@ -43,13 +42,13 @@ public class AuthorizationManagerMethodAfterAdviceTests {
@@ -43,13 +42,13 @@ public class AuthorizationManagerMethodAfterAdviceTests {
@ -42,13 +41,13 @@ public class AuthorizationManagerMethodBeforeAdviceTests {
@@ -42,13 +41,13 @@ public class AuthorizationManagerMethodBeforeAdviceTests {
.withMessage("authorizationManager cannot be null");
}
@ -58,7 +57,7 @@ public class AuthorizationManagerMethodBeforeAdviceTests {
@@ -58,7 +57,7 @@ public class AuthorizationManagerMethodBeforeAdviceTests {
@ -52,8 +50,8 @@ public class DelegatingAuthorizationMethodAfterAdviceTests {
@@ -52,8 +50,8 @@ public class DelegatingAuthorizationMethodAfterAdviceTests {
@ -69,8 +67,8 @@ public class DelegatingAuthorizationMethodAfterAdviceTests {
@@ -69,8 +67,8 @@ public class DelegatingAuthorizationMethodAfterAdviceTests {
@ -79,7 +77,7 @@ public class DelegatingAuthorizationMethodAfterAdviceTests {
@@ -79,7 +77,7 @@ public class DelegatingAuthorizationMethodAfterAdviceTests {
@ -94,8 +92,8 @@ public class DelegatingAuthorizationMethodAfterAdviceTests {
@@ -94,8 +92,8 @@ public class DelegatingAuthorizationMethodAfterAdviceTests {
@ -111,12 +109,12 @@ public class DelegatingAuthorizationMethodAfterAdviceTests {
@@ -111,12 +109,12 @@ public class DelegatingAuthorizationMethodAfterAdviceTests {
@ -131,8 +129,8 @@ public class DelegatingAuthorizationMethodAfterAdviceTests {
@@ -131,8 +129,8 @@ public class DelegatingAuthorizationMethodAfterAdviceTests {
@ -143,8 +141,8 @@ public class DelegatingAuthorizationMethodAfterAdviceTests {
@@ -143,8 +141,8 @@ public class DelegatingAuthorizationMethodAfterAdviceTests {
@ -47,8 +48,8 @@ public class DelegatingAuthorizationMethodBeforeAdviceTests {
@@ -47,8 +48,8 @@ public class DelegatingAuthorizationMethodBeforeAdviceTests {
@ -62,8 +63,8 @@ public class DelegatingAuthorizationMethodBeforeAdviceTests {
@@ -62,8 +63,8 @@ public class DelegatingAuthorizationMethodBeforeAdviceTests {
@ -76,7 +77,7 @@ public class DelegatingAuthorizationMethodBeforeAdviceTests {
@@ -76,7 +77,7 @@ public class DelegatingAuthorizationMethodBeforeAdviceTests {
@ -85,8 +86,8 @@ public class DelegatingAuthorizationMethodBeforeAdviceTests {
@@ -85,8 +86,8 @@ public class DelegatingAuthorizationMethodBeforeAdviceTests {
@ -100,8 +101,8 @@ public class DelegatingAuthorizationMethodBeforeAdviceTests {
@@ -100,8 +101,8 @@ public class DelegatingAuthorizationMethodBeforeAdviceTests {
@ -109,17 +110,17 @@ public class DelegatingAuthorizationMethodBeforeAdviceTests {
@@ -109,17 +110,17 @@ public class DelegatingAuthorizationMethodBeforeAdviceTests {
@ -131,10 +132,10 @@ public class DelegatingAuthorizationMethodBeforeAdviceTests {
@@ -131,10 +132,10 @@ public class DelegatingAuthorizationMethodBeforeAdviceTests {
@ -147,14 +148,9 @@ public class DelegatingAuthorizationMethodBeforeAdviceTests {
@@ -147,14 +148,9 @@ public class DelegatingAuthorizationMethodBeforeAdviceTests {
@ -39,29 +43,35 @@ public class PostFilterAuthorizationMethodAfterAdviceTests {
@@ -39,29 +43,35 @@ public class PostFilterAuthorizationMethodAfterAdviceTests {
@ -71,14 +81,15 @@ public class PostFilterAuthorizationMethodAfterAdviceTests {
@@ -71,14 +81,15 @@ public class PostFilterAuthorizationMethodAfterAdviceTests {
@ -90,6 +101,10 @@ public class PostFilterAuthorizationMethodAfterAdviceTests {
@@ -90,6 +101,10 @@ public class PostFilterAuthorizationMethodAfterAdviceTests {
@ -42,29 +45,35 @@ public class PreFilterAuthorizationMethodBeforeAdviceTests {
@@ -42,29 +45,35 @@ public class PreFilterAuthorizationMethodBeforeAdviceTests {
@ -75,7 +84,7 @@ public class PreFilterAuthorizationMethodBeforeAdviceTests {
@@ -75,7 +84,7 @@ public class PreFilterAuthorizationMethodBeforeAdviceTests {
@ -88,7 +97,7 @@ public class PreFilterAuthorizationMethodBeforeAdviceTests {
@@ -88,7 +97,7 @@ public class PreFilterAuthorizationMethodBeforeAdviceTests {
.withMessage("Filter target was null, or no argument with name 'list' found in method.");
@ -103,7 +112,7 @@ public class PreFilterAuthorizationMethodBeforeAdviceTests {
@@ -103,7 +112,7 @@ public class PreFilterAuthorizationMethodBeforeAdviceTests {
@ -115,7 +124,7 @@ public class PreFilterAuthorizationMethodBeforeAdviceTests {
@@ -115,7 +124,7 @@ public class PreFilterAuthorizationMethodBeforeAdviceTests {
.withMessage("Filter target was null. Make sure you passing the correct value in the method argument.");
@ -130,7 +139,7 @@ public class PreFilterAuthorizationMethodBeforeAdviceTests {
@@ -130,7 +139,7 @@ public class PreFilterAuthorizationMethodBeforeAdviceTests {
@ -143,7 +152,7 @@ public class PreFilterAuthorizationMethodBeforeAdviceTests {
@@ -143,7 +152,7 @@ public class PreFilterAuthorizationMethodBeforeAdviceTests {
@ -157,12 +166,13 @@ public class PreFilterAuthorizationMethodBeforeAdviceTests {
@@ -157,12 +166,13 @@ public class PreFilterAuthorizationMethodBeforeAdviceTests {
.withMessage("Unable to determine the method argument for filtering. Specify the filter target.");
}
@PreFilter("filterObject == 'john'")
publicstaticclassTestClass{
publicvoiddoSomething(){
@ -189,7 +199,6 @@ public class PreFilterAuthorizationMethodBeforeAdviceTests {
@@ -189,7 +199,6 @@ public class PreFilterAuthorizationMethodBeforeAdviceTests {