cancel
Showing results for 
Search instead for 
Did you mean: 

Show an action according to the custom role

sergi_l
Champ on-the-rise
Champ on-the-rise
Hi all!

I have defined my own custom roles to link each user group to the corresponding authorization.
There is a group that is only able to navigate and see content.
There is another group that is only able to navigate and see content, and able to execute a custom action (my print action).

So I have created my custom roles as:
<permissionSet type="cm:cmobject" expose="selected">
   <permissionGroup name="MyCustomRoleOnlyRead" allowFullControl="false" expose="true" >
          <includePermissionGroup permissionGroup="Read" type="sys:base" />
      </permissionGroup>

   <permissionGroup name="MyCustomRoleOnlyReadAndPrint" allowFullControl="false" expose="true" >
          <includePermissionGroup permissionGroup="Read" type="sys:base" />
      </permissionGroup>
   </permissionSet>

I have added them to type="cm:content" and type="cm:folder" as:

<permissionSet type="cm:content" expose="selected">
       <permissionGroup name="MyCustomRoleOnlyRead" extends="true" expose="true"/>
       <permissionGroup name="MyCustomRoleOnlyReadAndPrint" extends="true" expose="true"/>
</permissionSet>

And then I assign the custom roles to the action:
<action id="myAction">
            <permissions>
               <permission allow="false">MyCustomRoleOnlyRead</permission>
               <permission allow="true">MyCustomRoleOnlyReadAndPrint</permission>
            </permissions>
            <label-id>printDoc</label-id>
            <image>/sos/images/icons/icon.gif</image>
            <href>/wcs/sos/myscript?node=#{actionContext.nodeRef}</href>
      </action>

Finally, I assign to the user one role and later the other, and the result is the same. The action is not available for none of them!!
How the action has to be defined for this purpose?? I haven't found information about adding two or more permissions to the action node! Are they correctly added?
Many thanks!

Sergi
1 REPLY 1

sergi_l
Champ on-the-rise
Champ on-the-rise
Please, help!!
I think it could be related with the extend property. I mean, if the action would be available for "Contributor", a "Consumer" user wouldn't see it. But it'd be available for a "Collaborator" role according to the role hierarchy.

My roles contain the same permissions, I just want to allow the user to execute an action or not according to the role's user. This action is the unique difference between both.
How can I solve this issue??

Many thanks.