Results 1 to 4 of 4

Thread: Regular Expression Format While Specifying Roles.

  1. #1

    Default 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. #2
    Join Date
    Dec 2008
    Location
    New York City
    Posts
    134

    Default

    Quote 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 ?
    Andrew Thompson - Linked In

  3. #3

    Default

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

  4. #4
    Join Date
    Dec 2008
    Location
    New York City
    Posts
    134

    Default

    Quote 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
    Andrew Thompson - Linked In

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •