4343 * @since 5.0
4444 */
4545@ Configuration (proxyBeanMethods = false )
46+ @ Role (BeanDefinition .ROLE_INFRASTRUCTURE )
4647class ReactiveMethodSecurityConfiguration implements ImportAware {
4748
4849 private int advisorOrder ;
@@ -51,16 +52,17 @@ class ReactiveMethodSecurityConfiguration implements ImportAware {
5152
5253 @ Bean
5354 @ Role (BeanDefinition .ROLE_INFRASTRUCTURE )
54- MethodSecurityMetadataSourceAdvisor methodSecurityInterceptor (AbstractMethodSecurityMetadataSource source ) {
55+ static MethodSecurityMetadataSourceAdvisor methodSecurityInterceptor (AbstractMethodSecurityMetadataSource source ,
56+ ReactiveMethodSecurityConfiguration configuration ) {
5557 MethodSecurityMetadataSourceAdvisor advisor = new MethodSecurityMetadataSourceAdvisor (
5658 "securityMethodInterceptor" , source , "methodMetadataSource" );
57- advisor .setOrder (this .advisorOrder );
59+ advisor .setOrder (configuration .advisorOrder );
5860 return advisor ;
5961 }
6062
6163 @ Bean
6264 @ Role (BeanDefinition .ROLE_INFRASTRUCTURE )
63- DelegatingMethodSecurityMetadataSource methodMetadataSource (
65+ static DelegatingMethodSecurityMetadataSource methodMetadataSource (
6466 MethodSecurityExpressionHandler methodSecurityExpressionHandler ) {
6567 ExpressionBasedAnnotationAttributeFactory attributeFactory = new ExpressionBasedAnnotationAttributeFactory (
6668 methodSecurityExpressionHandler );
@@ -70,7 +72,7 @@ DelegatingMethodSecurityMetadataSource methodMetadataSource(
7072 }
7173
7274 @ Bean
73- PrePostAdviceReactiveMethodInterceptor securityMethodInterceptor (AbstractMethodSecurityMetadataSource source ,
75+ static PrePostAdviceReactiveMethodInterceptor securityMethodInterceptor (AbstractMethodSecurityMetadataSource source ,
7476 MethodSecurityExpressionHandler handler ) {
7577 ExpressionBasedPostInvocationAdvice postAdvice = new ExpressionBasedPostInvocationAdvice (handler );
7678 ExpressionBasedPreInvocationAdvice preAdvice = new ExpressionBasedPreInvocationAdvice ();
@@ -80,10 +82,11 @@ PrePostAdviceReactiveMethodInterceptor securityMethodInterceptor(AbstractMethodS
8082
8183 @ Bean
8284 @ Role (BeanDefinition .ROLE_INFRASTRUCTURE )
83- DefaultMethodSecurityExpressionHandler methodSecurityExpressionHandler () {
85+ DefaultMethodSecurityExpressionHandler methodSecurityExpressionHandler (
86+ ReactiveMethodSecurityConfiguration configuration ) {
8487 DefaultMethodSecurityExpressionHandler handler = new DefaultMethodSecurityExpressionHandler ();
85- if (this .grantedAuthorityDefaults != null ) {
86- handler .setDefaultRolePrefix (this .grantedAuthorityDefaults .getRolePrefix ());
88+ if (configuration .grantedAuthorityDefaults != null ) {
89+ handler .setDefaultRolePrefix (configuration .grantedAuthorityDefaults .getRolePrefix ());
8790 }
8891 return handler ;
8992 }
0 commit comments