Jump to content
We've recently updated our Privacy Statement, available here ×

Checking for multiple roles in a checkAuthenticationRoles condition


waalp

Recommended Posts

Hello people,

 

Is it possible to something like this :

 <condition test="checkAuthenticationRoles" testArgs="ROLE_SUPERUSER !! ROLE_ADHOC !! ROLE_DASHBOARD">
      stuff

</condition>

 

I need a menu item to apear if a user has one of these roles, so im looking for an OR construction.

 

Greetings,

Peter

Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

I can't seem to get it to work, i got this code now (in the actionModel-navigation.xml) :

      <condition test="checkAuthenticationRoles" testArgs="ROLE_ADHOC|ROLE_DASHBOARD|ROLE_SUPERUSER">
        <selectAction labelKey="NAV_005_CREATE">
            <condition test="checkAuthenticationRoles" testArgs="ROLE_ADHOC">
               <option labelKey="NAV_051_ADHOC_REPORT" action="primaryNavModule.navigationOption" actionArgs="designer"/>
            </condition>
            <condition test="checkAuthenticationRoles" testArgs="ROLE_DASHBOARD">
               <option labelKey="NAV_050_DASHBOARD" action="primaryNavModule.navigationOption" actionArgs="dashboard"/>
            </condition>
            <condition test="checkAuthenticationRoles" testArgs="ROLE_SUPERUSER">
                <option labelKey="NAV_056_DOMAIN" action="primaryNavModule.navigationOption" actionArgs="domain"/>
            </condition>
        </selectAction>
      </condition>
 

And although i'm superuser (so one of the roles above), the whole create menu is gone. Anyone knows what i'm doing wrong ?

 

 

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...