Alfresco provide various actions on the document and spaces which will help users to manipulate the document. It enables users to do various operations like delete, copy, move etc… on the document and space. On document details page actions can be seen on the right hand side.
Out of box various actions available on documents but each of these actions is shown based on the authorization of logged in user. Alfresco has feature called action evaluators which can be imposed on individual action which will decide particular action should be rendered or not for particular user or particular document. There are requirements where we need to hide some of the actions based on some criteria.
Alfresco have many of such action evaluators inbuilt which can be used to hide actions based on the criteria. Some of those actions created generic enough so that based on the parameter passed it will behave differently. There are various action evaluators like chainedMatchOne and chainedMatchAll available which allows chaining multiple actionevaluators to create complex criteria.All the inbuilt action evaluators can be found under
All the action evaluators listed there can be extended or reused.
For instance if we want to hide delete action for all the documents on which versionable aspect is applied.
Create custom-action-context.xml file with following entry
<bean id="custom.evaluator.doclib.hasversionable" class="org.alfresco.web.evaluator.HasAspectEvaluator"> <property name="aspects"> <list> <value> cm:versionable </value> </list> </property> </bean>
Place it under
Use above evaluator in share-config-custom.xml file to hide delete document action
Note: This is applicable to Alfresco Share User Interface only for Alfresco explorer interface you need to follow different set up steps to hide actions.
If inbuilt action evaluators do not meetup our requirement we can create custom action evaluators. We will see about it in upcoming posts.