43
43
* @since 5.0
44
44
*/
45
45
@ Configuration (proxyBeanMethods = false )
46
+ @ Role (BeanDefinition .ROLE_INFRASTRUCTURE )
46
47
class ReactiveMethodSecurityConfiguration implements ImportAware {
47
48
48
49
private int advisorOrder ;
@@ -51,16 +52,17 @@ class ReactiveMethodSecurityConfiguration implements ImportAware {
51
52
52
53
@ Bean
53
54
@ Role (BeanDefinition .ROLE_INFRASTRUCTURE )
54
- MethodSecurityMetadataSourceAdvisor methodSecurityInterceptor (AbstractMethodSecurityMetadataSource source ) {
55
+ static MethodSecurityMetadataSourceAdvisor methodSecurityInterceptor (AbstractMethodSecurityMetadataSource source ,
56
+ ReactiveMethodSecurityConfiguration configuration ) {
55
57
MethodSecurityMetadataSourceAdvisor advisor = new MethodSecurityMetadataSourceAdvisor (
56
58
"securityMethodInterceptor" , source , "methodMetadataSource" );
57
- advisor .setOrder (this .advisorOrder );
59
+ advisor .setOrder (configuration .advisorOrder );
58
60
return advisor ;
59
61
}
60
62
61
63
@ Bean
62
64
@ Role (BeanDefinition .ROLE_INFRASTRUCTURE )
63
- DelegatingMethodSecurityMetadataSource methodMetadataSource (
65
+ static DelegatingMethodSecurityMetadataSource methodMetadataSource (
64
66
MethodSecurityExpressionHandler methodSecurityExpressionHandler ) {
65
67
ExpressionBasedAnnotationAttributeFactory attributeFactory = new ExpressionBasedAnnotationAttributeFactory (
66
68
methodSecurityExpressionHandler );
@@ -70,7 +72,7 @@ DelegatingMethodSecurityMetadataSource methodMetadataSource(
70
72
}
71
73
72
74
@ Bean
73
- PrePostAdviceReactiveMethodInterceptor securityMethodInterceptor (AbstractMethodSecurityMetadataSource source ,
75
+ static PrePostAdviceReactiveMethodInterceptor securityMethodInterceptor (AbstractMethodSecurityMetadataSource source ,
74
76
MethodSecurityExpressionHandler handler ) {
75
77
ExpressionBasedPostInvocationAdvice postAdvice = new ExpressionBasedPostInvocationAdvice (handler );
76
78
ExpressionBasedPreInvocationAdvice preAdvice = new ExpressionBasedPreInvocationAdvice ();
@@ -80,10 +82,11 @@ PrePostAdviceReactiveMethodInterceptor securityMethodInterceptor(AbstractMethodS
80
82
81
83
@ Bean
82
84
@ Role (BeanDefinition .ROLE_INFRASTRUCTURE )
83
- DefaultMethodSecurityExpressionHandler methodSecurityExpressionHandler () {
85
+ DefaultMethodSecurityExpressionHandler methodSecurityExpressionHandler (
86
+ ReactiveMethodSecurityConfiguration configuration ) {
84
87
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 ());
87
90
}
88
91
return handler ;
89
92
}
0 commit comments