AnsweredAssumed Answered

Restrict use of execute-script-action to admin only

Question asked by xarope on Dec 7, 2015
Latest reply on Dec 8, 2015 by xarope
I'm using the replacement for the old alfresco explorer interface which allowed script execution, with the share-extras script found here:
http://share-extras.github.io/addons/execute-script-action/

To limit this use to only administrators, I made a simple change to the execute-script.get.js, wrapping up all the code in a conditional checking for whether the user is an admin:
if (user.isAdmin) {

}


And that works, but unfortunately doesn't hide the "Execute script" action from showing in the first place.

Anybody know how to hide this as well?

Perhaps in the share-config-custom.xml code, is there a way to also do a config evaluator where condition="isAdmin" or some equivalent?  e.g.

   <!– Custom Execute Script Action –>
   <config evaluator="string-compare" condition="isAdmin"> <!– just guessing! –>
     <config evaluator="string-compare" condition="DocLibActions">
        <actionGroups>
           <actionGroup id="folder-browse">
              <action index="980" id="org_sharextras_execute-script" />
           </actionGroup>
…etc…
     </config>
   </config>

Outcomes