I am trying to specify permissions for documents in a MarkLogic 6 database using the rest of the api.
This is the permissions metadata that I submit ( permissions.xml ):
<rapi:metadata xmlns:rapi="http://marklogic.com/rest-api" xmlns:prop="http://marklogic.com/xdmp/property"> <rapi:permissions> <rapi:permission> <rapi:role-name>arole</rapi:role-name> <rapi:capability>update</rapi:capability> </rapi:permission> <rapi:permission> <rapi:role-name>brole</rapi:role-name> <rapi:capability>read</rapi:capability> </rapi:permission> </rapi:permissions> </rapi:metadata>
using this command:
curl --anyauth --user user:pass -X PUT -T permissions.xml \ -H "Content-type: application/xml" \ "http://localhost:8003/v1/documents?uri=/test/test.xml&category=permissions"
When I look at permissions after this, I see:
arole (update) brole (read) rest-reader (read) rest-writer (update)
I expect that he will only have permissions for arole and brole.
The documentation says: "Unless explicitly set permissions, documents created using the MarkLogic REST API have read permission for the rest-reader role and update permission for the rest -writer . (And yes, I know, this example does not create a new document, but it does the same if I add a new document and set permissions simultaneously using a message with several messages + metadata via the rest api).
Setting permissions through direct xquery calls (e.g. xdmp:document-insert with permissions) using the same user and database works as expected.
How can I save the rest of the api from adding these extra permissions?
EDIT:
There is a ticket with MarkLogic, there is no date or version that I know about yet.
In case someone else comes across this, they really helped me: Create new roles (or change existing ones) and give them privileges to βperformβ for rest and / or rest, instead of inheriting the roles of readers / readers / generations , as well as the user directly assigning the role of recreation-reader / recreation.
rest permissions marklogic
paloma
source share