make XML and Java/Kotlin consistent with AspectJExpressionPointcut

This commit is contained in:
ANDREI LISA 2023-11-30 15:26:54 +02:00 committed by Steve Riesenberg
parent 0beda02a14
commit 1d769b5afc
No known key found for this signature in database
GPG Key ID: 5F311AB48A55D521
1 changed files with 4 additions and 4 deletions

View File

@ -1265,8 +1265,8 @@ import static org.springframework.security.authorization.AuthorityAuthorizationM
@Bean
@Role(BeanDefinition.ROLE_INFRASTRUCTURE)
static Advisor protectServicePointcut() {
JdkRegexpMethodPointcut pattern = new JdkRegexpMethodPointcut();
pattern.setPattern("execution(* com.mycompany.*Service.*(..))");
AspectJExpressionPointcut pattern = new AspectJExpressionPointcut();
pattern.setExpression("execution(* com.mycompany.*Service.*(..))");
return new AuthorizationManagerBeforeMethodInterceptor(pattern, hasRole("USER"));
}
----
@ -1281,8 +1281,8 @@ companion object {
@Bean
@Role(BeanDefinition.ROLE_INFRASTRUCTURE)
fun protectServicePointcut(): Advisor {
var pattern = JdkRegexpMethodPointcut();
pattern.setPattern("execution(* com.mycompany.*Service.*(..))");
var pattern = AspectJExpressionPointcut();
pattern.setExpression("execution(* com.mycompany.*Service.*(..))");
return new AuthorizationManagerBeforeMethodInterceptor(pattern, hasRole("USER"));
}
}