Nuxeo Server

How to Hide a Tab, a Link or a Button for a Group or a User

Updated: December 5, 2017 Page Information Edit on GitHub

This page is scheduled for review and update. Check back soon for updated content!

Hiding an Action

Goal: hide the "New" button to all member of a group named Group1.

If you are looking for another button or link, you can find all the contributions extending the service org.nuxeo.ecm.platform.actions.ActionService for the point actions in the Explorer.

In this example, you will define a filter for the action "New", which should be hidden for members of a group Group1. The id of this action is newDocument.

  1. The first thing you must do is to get the id of the action you would like to hide.The easiest way to do this is to activate the development mode in the UI. To get the information of an element in the UI, keep the 'shift' key pressed and mouse over the element you are looking for. A panel will display the information at the bottom of the page. The process to activate this mode is described here: How to Activate UI Development Mode Get the id of the action "New"
  2. Add a contribution in your Studio project to create a filter for the action we would like to hide. This contribution extends the service org.nuxeo.ecm.platform.actions.ActionService for the point actions. Create also the filter denyForGroup1: In the same contribution, you have to extend the service org.nuxeo.ecm.platform.actions.ActionService for the point filters. Please refer to the section about Filters and Access Controls.

    If you are not familiar with the contribution of an extension in Studio, please read this documentation: How to Contribute to an Extension.

    src/main/resources/OSGI-INF/actions-contribution.xml

    <extension target="org.nuxeo.ecm.platform.actions.ActionService"
      point="actions">
      <action id="newDocument">
        <filter-id>denyForGroup1</filter-id>
      </action>
    </extension>
    
    <extension target="org.nuxeo.ecm.platform.actions.ActionService"
      point="filters">
      <filter id="denyForGroup1">
        <rule grant="false">
          <group>Group1</group>
        </rule>
      </filter>
    </extension>
    

  3. If you want to completely remove the action, the contribution is slightly different. You must add the parameter enabled="false" when defining the action.

    src/main/resources/OSGI-INF/actions-contribution.xml

    <extension target="org.nuxeo.ecm.platform.actions.ActionService"
      point="actions">
      <action id="newDocument" enabled="false" />
    </extension>
    

In this example, the name of the group to be excluded was hardcoded. It is also possible to create a method which returns a list of group names to exclude.

Find more information related to Actions and filters in the documentation and details for the extension point in the Explorer.

Disabling Tabs on Your Document Type Using Nuxeo Studio

When you define new document types, you can customize the tabs that are presented. On documents like notes or files, you can disable the tabs inherited from the extended Nuxeo document type using Studio.

This can be done on any document type, folderish or not.

To disable tabs on your document type, in Studio:

  1. On your document type definition, click on the Tabs tab.
  2. Check the tabs that you don't want to be displayed for your document (ex: Comment, History, Preview,...).
  3. Click on Save so your changes are kept.

 

5 days ago Manon Lumeau add tags for doc days
a month ago manonlumeau Added content-review-lts2017 label
2 months ago manonlumeau NXDOC-1346-FT review screenshot
a year ago Solen Guitter 18 | pdate how-to topic
2 years ago Manon Lumeau 17
2 years ago Anahide Tchertchian 16
3 years ago Manon Lumeau 15
3 years ago Manon Lumeau 14
3 years ago Anahide Tchertchian 13 | add link to action filters configuration
3 years ago Solen Guitter 12
3 years ago Anahide Tchertchian 11
3 years ago Anne Jubert 10
3 years ago Thierry Martins 9
3 years ago Solen Guitter 8
3 years ago Solen Guitter 7
3 years ago Gildas Lefevre 6 | NXDOC-441: Add a link to the 'how to' for activate the dev mode
3 years ago Gildas Lefevre 5 | NXDOC-441: Update layout of the page
3 years ago Gildas Lefevre 4
3 years ago Gildas Lefevre 3 | NXDOC-441: Add the Studio contribution
3 years ago Solen Guitter 2 | Format, add links
3 years ago Gildas Lefevre 1
History: Created by Gildas Lefevre