mirror of
https://github.com/spring-projects/spring-security.git
synced 2025-07-05 10:12:36 +00:00
make XML and Java/Kotlin consistent with AspectJExpressionPointcut
This commit is contained in:
parent
0beda02a14
commit
1d769b5afc
@ -1265,8 +1265,8 @@ import static org.springframework.security.authorization.AuthorityAuthorizationM
|
|||||||
@Bean
|
@Bean
|
||||||
@Role(BeanDefinition.ROLE_INFRASTRUCTURE)
|
@Role(BeanDefinition.ROLE_INFRASTRUCTURE)
|
||||||
static Advisor protectServicePointcut() {
|
static Advisor protectServicePointcut() {
|
||||||
JdkRegexpMethodPointcut pattern = new JdkRegexpMethodPointcut();
|
AspectJExpressionPointcut pattern = new AspectJExpressionPointcut();
|
||||||
pattern.setPattern("execution(* com.mycompany.*Service.*(..))");
|
pattern.setExpression("execution(* com.mycompany.*Service.*(..))");
|
||||||
return new AuthorizationManagerBeforeMethodInterceptor(pattern, hasRole("USER"));
|
return new AuthorizationManagerBeforeMethodInterceptor(pattern, hasRole("USER"));
|
||||||
}
|
}
|
||||||
----
|
----
|
||||||
@ -1281,8 +1281,8 @@ companion object {
|
|||||||
@Bean
|
@Bean
|
||||||
@Role(BeanDefinition.ROLE_INFRASTRUCTURE)
|
@Role(BeanDefinition.ROLE_INFRASTRUCTURE)
|
||||||
fun protectServicePointcut(): Advisor {
|
fun protectServicePointcut(): Advisor {
|
||||||
var pattern = JdkRegexpMethodPointcut();
|
var pattern = AspectJExpressionPointcut();
|
||||||
pattern.setPattern("execution(* com.mycompany.*Service.*(..))");
|
pattern.setExpression("execution(* com.mycompany.*Service.*(..))");
|
||||||
return new AuthorizationManagerBeforeMethodInterceptor(pattern, hasRole("USER"));
|
return new AuthorizationManagerBeforeMethodInterceptor(pattern, hasRole("USER"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user