-
Notifications
You must be signed in to change notification settings - Fork 6k
RoleHierarchy is not used by AbstractAuthorizeTag #7059
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
Comments
After doing some more research, I think this issue is related to #5272 |
Thanks for the report @larsgrefer! Would you be willing to submit a PR for this? |
I'm not sure how exactly this PR should look like. Ideally there would be only one |
@larsgrefer I think we should start by fixing the immediate problem and updating the configuration to be kept in sync. This will be faster and less risky (which is desirable for a bug fix). We can explore using the same instance in a separate PR. |
@rwinch I can take this task. |
Thank you @evgeniycheban The issue is yours |
Summary
I've noticed a strange behaviour when setting up a
RoleHierarchy
in a simple Spring Boot application, when trying to use it withorg.springframework.security.taglibs.authz.AbstractAuthorizeTag
Actual Behavior
Effektively two
DefaultWebSecurityExpressionHandler
get created:spring-security/config/src/main/java/org/springframework/security/config/annotation/web/builders/WebSecurity.java
Lines 98 to 100 in ce79ef2
spring-security/config/src/main/java/org/springframework/security/config/annotation/web/configurers/ExpressionUrlAuthorizationConfigurer.java
Lines 209 to 231 in ce79ef2
The second one picks up my
RoleHierarchy
bean, but the first doesnt.org.springframework.security.taglibs.authz.AbstractAuthorizeTag#getExpressionHandler
resolves the first handler, therefore theRoleHierarchy
is ignored.Expected Behavior
I'd expect
AbstractAuthorizeTag
to use myRoleHierarchy
when resolvinghasRole()
expressions.Configuration
Version
Spring Security 5.2.0.M3
Sample
see #2997
see #4115
see 8a66d0c#diff-23827daef0917bb5218098c8108b9125
The text was updated successfully, but these errors were encountered: