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

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


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 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!

Copy link

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
type: bug type: jira
None yet

No branches or pull requests

2 participants