cancel
Showing results for 
Search instead for 
Did you mean: 

Action configuration

qsdmv
Champ in-the-making
Champ in-the-making
I would like to configure action based on a condition. If the user has role like 'COORDINATOR', then execute action 'test1', otherwise, it will execute 'test2'. Action 'test1' might be just simple action and action 'test2' might be dialog/widget. How do we achieve this? Thanks in advance.
4 REPLIES 4

muralidharand
Star Contributor
Star Contributor
Do you want to display your custom action in document library action or how?
Can you please elaborate bit more, if possible with screenshots?

qsdmv
Champ in-the-making
Champ in-the-making
I have two custom actions (action1 and action2). Can I do anything like that? (pseudo codes, not sure that it supports or not):

<action-group id="document_browse_menu">
               if ( role == 'changecontent')
                    <action idref="action1" />
               else
                   <action idref="action2" />
                <action idref="regularaction" />
            </action-group>


So that you see either action1, regularaction or action2, regularaction from document browser drop down menu.

Thanks in advance

Hi,
I guess you should be able to with actions and evaluators(default or custom).
Here is the code snippet.

<action id="action1" type="javascript" label="Action 1">
    <param name="function">onActionDetails</param>
    <permissions>
       <permission allow="true">Write</permission>
    </permissions>
   evaluator negate="false">evaluator.doclib.action.isSiteManager</evaluator>
</action>
        
        
<action id="action2" type="javascript" label="Action 2">
    <param name="function">onActionDetails</param>
    <permissions>
       <permission allow="true">Write</permission>
    </permissions>
    <evaluator negate="false">evaluator.doclib.action.isSiteCollaborator</evaluator>
</action>


You can refer
slingshot-documentlibrary-context.xml 
file for the existing document actions and its evaluators.
Let me know, if you need any additional help on this.

qsdmv
Champ in-the-making
Champ in-the-making
Thank you Murali. I will try this and let you know.