Organizational Research By

Surprising Reserch Topic

Question:Is there a way to configure Roles in a property file for Spring security MVC app


I have a spring security MVC application. In few JSP files I have code that looks like this:


    


I have to make code changes (changing ROLE_FOO to something else) when deploying the app to production because it has different role names. So I was wondering whether there is a way to configure these role names in a property file and then pick those inside the tag.

So the code would look something like this:

Property File:

Admin_Roles = ROLE_FOO ROLE_BAR

and JSP


    


btw, I am using Active Directory for authentication so these roles are pre-configured in the active directory for test and production.

asked Sep 13, 2013 in Core java by anonymous
edited Sep 12, 2013
0 votes
709 views



Related Hot Questions

2 Answers

0 votes
Not sure it is the easiest way. But you can write your own expression.

This link should be very useful. link

Since there are some differences between each version. You had better take a look at the source code of DefaultWebSecurityExpressionHandler to make sure you do not miss anything when override createSecurityExpressionRoot
answered Sep 13, 2013 by anonymous
edited Sep 12, 2013
0 votes
Not sure it is the easiest way. But you can write your own expression.

This link should be very useful. link

Since there are some differences between each version. You had better take a look at the source code of DefaultWebSecurityExpressionHandler to make sure you do not miss anything when override createSecurityExpressionRoot
answered Sep 13, 2013 by anonymous
edited Sep 12, 2013

...