Add GrantedAuthorityDefaults to Expression Handler

Issue gh-9289
This commit is contained in:
Josh Cummings 2021-04-08 07:47:54 -06:00
parent 68cf74468c
commit 62d77ec97e
No known key found for this signature in database
GPG Key ID: 49EF60DD7FF83443
1 changed files with 5 additions and 1 deletions

View File

@ -107,7 +107,11 @@ final class MethodSecurityConfiguration implements ImportAware, InitializingBean
private MethodSecurityExpressionHandler getMethodSecurityExpressionHandler() { private MethodSecurityExpressionHandler getMethodSecurityExpressionHandler() {
if (this.methodSecurityExpressionHandler == null) { if (this.methodSecurityExpressionHandler == null) {
this.methodSecurityExpressionHandler = new DefaultMethodSecurityExpressionHandler(); DefaultMethodSecurityExpressionHandler methodSecurityExpressionHandler = new DefaultMethodSecurityExpressionHandler();
if (this.grantedAuthorityDefaults != null) {
methodSecurityExpressionHandler.setDefaultRolePrefix(this.grantedAuthorityDefaults.getRolePrefix());
}
this.methodSecurityExpressionHandler = methodSecurityExpressionHandler;
} }
return this.methodSecurityExpressionHandler; return this.methodSecurityExpressionHandler;
} }