Hide Edit tab for users with access rights "write"

Hi There,

In Nuxeo 5.8 I want to hide the edit tab for users with access rights : “write”. The tab should be available for users with access rights: “manage everything”. In Studio I've added the following extension points:

<extension target="org.nuxeo.ecm.platform.actions.ActionService"  point="actions">
  <action id="TAB_WORKSPACE_EDIT">
    <filter-id>denyForWrite</filter-id>
  </action>
</extension>

<extension target="org.nuxeo.ecm.platform.actions.ActionService"  point="filters">
  <filter id="denyForWrite">
    <rule grant="false">
      <permission>Write</permission>
      <type>Workspace</type>
      <type>WorkspaceRoot</type>
    </rule>
    <rule grant="true">
      <permission>Manage everything</permission>
      <type>Workspace</type>
      <type>WorkspaceRoot</type>
    </rule>
  </filter>
</extension>

For some reason however the tab is also hidden for users with “manage everything” rights, I also noticed that when I don't have the <type>WorkspaceRoot</type> specified it also hides the button in the workspaceroot. Is there something I'm not doing right?

Thanks in advance, Bauke Roo

0 votes

1 answers

1428 views

ANSWER



Hi Bauke,

Regrets for you because this question is not answered for past one year. If you are still in search of a solution then i have the code for it. Paste the code at the same file.

<extension target="org.nuxeo.ecm.platform.actions.ActionService"  point="actions">
  <action id="TAB_WORKSPACE_EDIT">
    <filter-id>denyForWrite</filter-id>
  </action>
</extension>

<extension target="org.nuxeo.ecm.platform.actions.ActionService"  point="filters">
  <filter id="denyForWrite">
       <rule grant="true">
      <permission>Manage everything</permission>
      <type>Workspace</type>
      <type>WorkspaceRoot</type>
    </rule>
  </filter>
</extension>

The mistake in your code was in the filter. When edit tab is disabled for Write permission and you are enabling it for Manage Everything ,it doesn't make sense as manage everything has Write right with in it. So even *Manage Everything * user is getting blocked.

My code just enables Edit tab for Manage Everything right and blocks for all other rights.

Regards

0 votes