Addons

HOWTO: Hide a Tab, a Link or a Button for a Group or a User - JSF UI

Updated: December 19, 2024

JSF UI Deprecation
This requires to have the JSF UI addon installed on your server that is deprecated since Nuxeo Platform LTS 2019.
Please refer to the Web UI documentation.

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.