AnsweredAssumed Answered

How to hide menu-options for specific content-type

Question asked by ravichandanani on Apr 15, 2013
Latest reply on Apr 17, 2013 by ravichandanani
Hello,

I have a custom content type(bm:mybook) and its folder , I want to hide options like "Manage-Rule" for that particular content-type. can anyone please help me to configure that in share.



currently I have added following code in share-config-custom.xml, and I have created Java evaluator which checks if the content-type is bm:mybook and it returns true or false, based on the result false it excludes options Manage-Rule from the folder menu-list in share.


<actionGroups evaluator="node-type">

<actionGroup id="folder-browse">
   <action index="170" id="folder-manage-rules" >
      <evaluator>evaluator.doclib.action.excludeMyBook</evaluator>
   </action>
</actionGroup>

<actionGroups>


Evaluator code.


public class ExcludeMyBook extends BaseEvaluator{

   @Override
   public boolean evaluate(JSONObject jsonObject) {
      
      String nodeType = getNodeType(jsonObject); 
      
      if(nodeType.equalsIgnoreCase("bm:myBook")){
         return false;
      }
      return true;
   }
}



is there any other way of configuring this easily.

Thanks in advance

Outcomes