Announcement Announcement Module
Collapse
No announcement yet.
Regular Expression Format While Specifying Roles. Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Regular Expression Format While Specifying Roles.

    Hi All,

    In my applicationContext-security.xml file, I have the following code..

    Code:
    <security:intercept-url pattern="/*.do" access="hasAnyRole('ROLE_ABC','ROLE_CDE','ROLE_FGH','ROLE_IJK','ROLE_XYZ')"/>
    If there are 10 roles(with big Role names), then I need to specify ten different things.

    Now, my question is, is there a way to specify roles with regular expression format, like ROLE_* ?

    Thanks,
    Vivekanand Alampally

  • #2
    Originally posted by vivek4348 View Post
    Hi All,

    In my applicationContext-security.xml file, I have the following code..

    Code:
    <security:intercept-url pattern="/*.do" access="hasAnyRole('ROLE_ABC','ROLE_CDE','ROLE_FGH','ROLE_IJK','ROLE_XYZ')"/>
    If there are 10 roles(with big Role names), then I need to specify ten different things.

    Now, my question is, is there a way to specify roles with regular expression format, like ROLE_* ?

    Thanks,
    Vivekanand Alampally
    Have you looked at changing the "path-type" to regex as shown in http://static.springsource.org/sprin...b-filters.html ?

    Comment


    • #3
      Thanks Arthomps for your response,

      I think "path-type" is for URL pattern.. My problem is how to specify Role Names in regular expression format..

      Comment


      • #4
        Originally posted by vivek4348 View Post
        Thanks Arthomps for your response,

        I think "path-type" is for URL pattern.. My problem is how to specify Role Names in regular expression format..
        My bad. Take a look at https://gist.github.com/1642655

        Comment

        Working...
        X