cancel
Showing results for 
Search instead for 
Did you mean: 

How can I prevent a user action to be shown if the user has Write right?

elteo_
Champ on-the-rise
Champ on-the-rise

I have defined a user action that only needs to be shown if the current user doesn't have Write permission on the current document. My guess is I should use the "Custom EL expression" field in Studio but I could use some guidance on what to write there.

Basically I want it to say " Show the user action this only if the user doesn't have Write permission"

1 ACCEPTED ANSWER

Benjamin_Jalon1
Elite Collaborator
Elite Collaborator

Hi,

I found a ugly way to do that, waiting of a better solution:

${documentManager.hasPermission(currentDocument.getRef(), "Write") == false}

View answer in original post

3 REPLIES 3

Benjamin_Jalon1
Elite Collaborator
Elite Collaborator

Hi,

I found a ugly way to do that, waiting of a better solution:

${documentManager.hasPermission(currentDocument.getRef(), "Write") == false}

Thierry_Martins
Star Collaborator
Star Collaborator

hello,

the right way is to define a rule that deny access (grant=false) after checking the permission Write. For instance:

<action id="M_USER_ACTION" link="#{foo.bar}" order="100"
  label="foobar" icon="/icons/foobar.png">
  <category>VIEW_ACTION_LIST</category>
  <filter id="foobar-filter">
    <rule grant="false">
      <permission>Write</permission>
    </rule>
  </filter>
</action>

this solution is not compliant with using Nuxeo Studio, the previous one will work better