romain-nio
romain-nio

Reputation: 1205

Add rights to delete document in MarkLogic through Role

I have a role called "monitoring" able to insert/view documents in MarkLogic. I want to add the right to delete documents but I don't know if I need to give it the "execute" privilege.

My role is the following :

<role>
  <role-name>moderators-role</role-name>
  <description>The role assigned to the zabbix user that monitor all server apps</description>
  <permissions>
    <permission>
      <capability>read</capability>
      <role-name>moderators-role</role-name>
    </permission>
    <permission>
      <capability>update</capability>
      <role-name>moderators-role</role-name>
    </permission>
  </permissions>
  <privileges>
    <privilege>
      <privilege-name>rest-writer</privilege-name>
    </privilege>
    <privilege>
      <privilege-name>rest-reader</privilege-name>
    </privilege>
  </privileges>
</role>

Upvotes: 1

Views: 115

Answers (1)

To delete a document, the user/role needs the document permission called 'update'. There is no particular execute role for this as it is related to the permissions of specific documents.

Check the permissions on a single document in question (xdmp:document-get-permissions) and see if your user such as rest-writer has an update permission on the document.

It should be noted that as long as these documents were not inserted by the admin role, then at least one update permission will already be present on the document.

Upvotes: 5

Related Questions