Wire BeanResolver into DefaultMethodSecurityExpressionHandler
Closes gh-10305
This commit is contained in:
@@ -350,6 +350,14 @@ public class PrePostMethodSecurityConfigurationTests {
|
||||
.isThrownBy(() -> this.businessService.repeatedAnnotations());
|
||||
}
|
||||
|
||||
// gh-10305
|
||||
@WithMockUser
|
||||
@Test
|
||||
public void beanInSpelWhenEvaluatedThenLooksUpBean() {
|
||||
this.spring.register(MethodSecurityServiceConfig.class).autowire();
|
||||
this.methodSecurityService.preAuthorizeBean(true);
|
||||
}
|
||||
|
||||
@EnableMethodSecurity
|
||||
static class MethodSecurityServiceConfig {
|
||||
|
||||
@@ -358,6 +366,11 @@ public class PrePostMethodSecurityConfigurationTests {
|
||||
return new MethodSecurityServiceImpl();
|
||||
}
|
||||
|
||||
@Bean
|
||||
Authz authz() {
|
||||
return new Authz();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@EnableMethodSecurity(jsr250Enabled = true)
|
||||
|
||||
Reference in New Issue
Block a user