I want to display some content conditionally based on Roles using Spring Security JSP taglibs.
But in Spring Security 3.1.x is checking for only one role.
I can use but ifAllGranted is deprecated.
Any help?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
There is a special security expression in spring security:
I have never used it but I think it is exactly what you are looking for.
Example usage:
Here is a link to the reference documentation where the standard spring security expressions are described. Also, here is a discussion where I described how to create custom expression if you need it.