Skip to content
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

SEC-2926: request.isUserInRole() works fine with roles which not start with ROLE #3137

Closed
spring-projects-issues opened this issue Mar 31, 2015 · 1 comment
Assignees
Labels
type: bug type: jira
Milestone

Comments

@spring-projects-issues
Copy link

spring-projects-issues commented Mar 31, 2015

Alireza Fattahi (Migrated from SEC-2926) said:

We have added some custom role to user authorities. For example ("OWNER")

calling the request.isUserInRole() works fine.
calling the <sec:authentication property="principal.authorities"/> prints the user role. [OWNER]
The <sec:authorize access="hasRole('OWNER')"> is not working

I set the ROLE prefix to be ignored as mentioned in http://docs.spring.io/spring-security/site/migrate/current/3-to-4/html5/migrate-3-to-4-xml.html and both isUserInRole() and sec:authentication worked fine.

I wonder why isUserInRole() was working fine before seting the ROLE prefix ignorance. This is somehow miss-leading!

@spring-projects-issues
Copy link
Author

spring-projects-issues commented Mar 31, 2015

Rob Winch said:

Thanks for the report! You are right this is misleading and is a bug.

The problem is that we do not set the SecurityContextHolderAwareRequestWrapper rolePrefix properly. This will be resolved in 4.0.1 at which time the guide will also need to be updated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug type: jira
Projects
None yet
Development

No branches or pull requests

2 participants