AnsweredAssumed Answered

Hide Tags component for Consumer users on document details page

Question asked by bbiais on Jan 29, 2015
Latest reply on Feb 20, 2015 by bbiais
Hello,

On the document details page, I would like to hide the panel "Tags" (cf screenshot) but only for Consumer users.

For that, I did this tutorial, especially the part « Remove the Tags panel component ».
http://blogs.alfresco.com/wp/ewinlof/2011/11/09/add-remove-or-replace-components-on-shares-document-details-page/

I generated the .jar file and deployed it on Alfresco. In the file acme-test-extension.xml, the original code works, hiding the "Tags" panel:


<!– Remove Tag Panel –>
<component>
   <scope>template</scope>
   <region-id>document-tags</region-id>
   <source-id>document-details</source-id>
   <sub-components>
     <sub-component id="default">
       <evaluations>
         <evaluation id="acme-test-removeTags">
            <render>false</render>
         </evaluation>
       </evaluations>
     </sub-component>
  </sub-components>
</component>


Then, I tried to change the code to hide the Tags panel only for Consumer, using evaluator « group.component.evaluator ».


<!– Remove Tag Panel –>
<component>
   <scope>template</scope>
   <region-id>document-tags</region-id>
   <source-id>document-details</source-id>
   <sub-components>
     <sub-component id="default">
       <evaluations>
         <evaluation id="acme-test-removeTags">
            <evaluators>
               <evaluator type="group.component.evaluator">
                                        <params><groups>SiteConsumer</groups></params>
               </evaluator>
            </evaluators>
            <render>false</render>
         </evaluation>
       </evaluations>
     </sub-component>
  </sub-components>
</component>


However, it doesn’t work, the Tags panel is displayed for all users.

I think this is related to the type evaluator, maybe I need to create my own class, but it’s not easy to find some tips to manage permissions for components extensions. Where could I find some examples to achieve this?

Thanks for your help!

Outcomes