I have a role convention mechanism in my application for which each role follows a syntax:
APP_DEPARTMENT1_USER
APP_DEPARTMENT1_AUDITOR
APP_DEPARTMENT1_WHATEVER
APP_DEPARTMENT2_...
I want to configure Spring security in order to allow all roles that match a given suffix to be granted access to a section of my web application. I blindly tried <intercept-url pattern="/secure/audit/**" access="APP_*_AUDITOR,APP_ADMINISTRATOR" />
(where APP_ADMINISTRATOR
is my default administrator role) but it didn't work. When I log in as administrator I can access the page, but when I try to log in with a profile with the APP_DEPARTMENT1_AUDITOR
I can't obtain access to the page.
I think wildcard expressions are not supported, and I don't believe Spring EL expressions could be of help (or I just don't master them enough).
Is there any way I can configure a role pattern for Spring Security within <intercept-url>
tag?