Announcement Announcement Module
Collapse
No announcement yet.
Give access to more than one group Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Give access to more than one group

    I would like to know, if it's possible to give access to more than one group? I was hoping to use something like this:
    PHP Code:
    <security:authorize ifAllGranted="ROLE-ADMINISTRATOR, ROLE-OWNER">
       <
    p>CongratulationsYou're an admin or the owner of this content!</p>
    </security:authorize> 
    But, of course it's not working. I appreciate any comments how to do this properly.

  • #2
    TomBlank,
    That is the correct usage of the authorize tag for your requirement. I wonder if there is a typo and role names are supposed to be ROLE_ADMINISTRATOR, ROLE_OWNER (use a _ instead of a -)

    Also, this is a question regarding Spring Security and you might get more replies if you were to ask it in the Spring Security forum.

    Comment


    • #3
      You currently secured your content for a user which has both roles, if you want either you probably want to use the ifAnyGranted instead of the allGranted. I suggest a read of the reference guide which explains the tags..

      Comment


      • #4
        Hey Marten,

        'ifAnyGranted' worked!

        Thanks a lot!

        Comment

        Working...
        X