Writing action evaluators to show/hide UI actions
In the previous example, you set up two action items to enable and disable the isActive
flag for a webable piece of content. The actions only show up if a user has the appropriate permissions. But what if SomeCo wants to give several different people or groups Write
permission, but only wants a subset of those folks to be able to publish documents to the Web? Not only that, but isn't it a bit sloppy to show the Enable link when the isActive
flag is already set to True (and Disable when it is already set to False)?
Both of these issues are easily addressed using Spring beans and out-of-the-box Alfresco Share evaluators. Evaluators are used to control if an action item should be displayed or not. If you don't find what you need in the standard evaluators, you can as well create your own evaluator coded in Java (more information here http://docs.alfresco.com/5.1/tasks/dev-extensions-share-tutorials-custom-evaluator.html).