Results 1 to 3 of 3

Thread: Expression-Based Access Control- use wildcard "ROLE_*"

  1. #1
    Join Date
    Feb 2011
    Posts
    4

    Default Expression-Based Access Control- use wildcard "ROLE_*"

    <intercept-url pattern="/**" access="ROLE_ADMIN"/>

    in place of ADMIN can i use a wildcard like access="ROLE_*_Admin" or ROLE_*

    appreciate your help

  2. #2
    Luke Taylor is offline Senior Member Acegi Security System TeamSpring Team
    Join Date
    Aug 2004
    Location
    Glasgow, Scotland
    Posts
    3,449

    Default

    You can use any attributes you want, but the actual interpretation depends on the AccessDecisionManager and the combination of AccessDecisionVoter instances it is configured with. ROLE_ attributes are typically processed by an instance of the class RoleVoter. If you want to do something like this you'd need to write a customized version instead which handler wildcarded role names.

    Note that this isn't expression-based access control. In that case the attribute is interpreted as an EL expression. So "ROLE_ADMIN" wouldn't be a valid expression.
    Spring - by Pivotal
    twitter @tekul

  3. #3
    Join Date
    Feb 2011
    Posts
    4

    Default

    Thank you very much. Is there a working example that I could look at. I am kind of new to this topic and it would really help if you can put me in the right direction.

    I just wanted to add that I am using LDAP for authentication and authorization. I do not want to use ACL's I have created my custom authorities and they all normally end with either ADMIN or STAFF at the end. so, Please suggest me the best way to get this working.
    Last edited by rudy81; May 25th, 2011 at 09:13 AM.

Posting Permissions

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