Setting Permissions Explicitly
- Last Updated: May 20, 2026
- 1 minute read
- MarkLogic Server
- Version 12.0
- Documentation
Assume that the following code snippet is executed as user Ron of the engineering role. The code inserts a document with the following permissions:
-
readandinsertpermissions for theengineeringrole -
update,node-update, andreadpermissions for theengineering-managerrole
...
xdmp:document-insert("/widget.com/engineering/features/2017-q1.xml",
<new-features>
<feature>
<name>blue whistle</name>
<assigned-to>Ron</assigned-to>
...
</feature>
...
</new-features>,
(xdmp:permission("engineering", "read"),
xdmp:permission("engineering", "insert"),
xdmp:permission("engineering-manager", "read"),
xdmp:permission("engineering-manager", "update"),
xdmp:permission("engineering-manager", "node-update"))
...
If you specify permissions to the function call explicitly, as shown above, those permissions override any default permission settings associated with the user (through user settings and role inheritance).