-
Notifications
You must be signed in to change notification settings - Fork 6k
AuthorityAuthorizationManager never using defined role hierarchy #12473
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
I found this way to enable role hierarchies. Is this the expected way to do it?
|
Thanks for reaching out, @davidvelasco-lk. This is what is supported at this point, yes. It would be nice if |
Hi, @jzheaux I should've added this functionality in gh-12231, but I didn't take into account such use case, I'm going to add this in a new PR, so the user will be able to define |
…for a RoleHierarchy bean in the context Closes spring-projectsgh-12473
…for a RoleHierarchy bean in the context Closes gh-12473
@davidvelasco-lk & @jzheaux to authorized if we want enable method level security. and secure endpoints with annotation in controller level not in SpringSecurityConfig Class level then how we can configure that? |
Describe the bug
Defined role hierarchy is not picked up by AuthorityAuthorizationManager.
/greet
is authorized to role USERuser
is configured as SUPERUSER. According to defined role hierarchy, access to resource should be granted.After debugging I found that
AuthorityAuthorizationManager
is always usingNullRoleHierarchy
. This setter is never being assigned to the one I created.Env: spring boot 3.0.0 / spring security 6.0.0
Context: Upgrading from spring boot 2.7.x to spring boot 3.0.0
To Reproduce
user: user
password: pass
Expected behavior
Should return "hello world" string
Sample
Example project.
The text was updated successfully, but these errors were encountered: