-
Notifications
You must be signed in to change notification settings - Fork 6k
Set "rolePrefix" in ReactiveMethodSecurityConfiguration #6801
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Thanks, @ttddyy! Would you also be able to write some tests that confirm that this behavior works as expected? I think none have been added to this point, but you should be able to do something similar to And then, is there any reason that you chose to have the |
a6771d7
to
f0105d6
Compare
Hi @jzheaux Updated the PR for
Thanks, |
f0105d6
to
3d58d9b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR! I have provided feedback inline
* @since 5.0 | ||
*/ | ||
@Configuration | ||
class ReactiveMethodSecurityConfiguration implements ImportAware { | ||
private int advisorOrder; | ||
|
||
@Autowired(required = false) | ||
private GrantedAuthorityDefaults grantedAuthorityDefaults; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a package private setter and move the @Autowired(required = false)
on to the setter to align with gh-6624
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rwinch Updated the PR to add a package private setter for Spring Fu support.
Currently, `GrantedAuthorityDefaults` is not considered in `ReactiveMethodSecurityConfiguration`. This commit updates the configuration to be aware of `GrantedAuthorityDefaults` and update `rolePrefix` when the bean is available. Also, use the same instance of `DefaultMethodSecurityExpressionHandler` when constructing `ExpressionBasedAnnotationAttributeFactory`.
3d58d9b
to
d619434
Compare
Currently,
GrantedAuthorityDefaults
is not considered inReactiveMethodSecurityConfiguration
.This commit updates the configuration to be aware of
GrantedAuthorityDefaults
and updaterolePrefix
when the bean isavailable.
Also, use the same instance of
DefaultMethodSecurityExpressionHandler
when constructing
ExpressionBasedAnnotationAttributeFactory
.