Steps for Example Setup
- Last Updated: May 20, 2026
- 1 minute read
- MarkLogic Server
- Version 12.0
- Documentation
To set up this example scenario, perform the following steps, using the Admin Interface:
-
Create a role named
ReadsStuff. -
Create a user named
ReadOnlyand grant this user theReadsStuffrole. -
Create a role named
WritesStuffand grant this role theReadsStuffrole. -
Grant the
WritesStuffrole theany-uriprivilege, as well as any execute privileges needed for your application code. -
Create a user named
LoadsStuffand grant this user theWritesStuffrole. When you load documents, load them as theLoadsStuffuser and give each document an update and insert permission for theWritesStuffrole and a read permission for theReadsStuffrole.
Here is sample code to create a set of permissions with xdmp:permission():
(xdmp:permission("ReadsStuff", "read"),
xdmp:permission("WritesStuff", "insert"),
xdmp:permission("WritesStuff", "update"))
You can also create a set of permissions with the permissions option of either xdmp:document-insert() or xdmp:document-load().
Also, instead of specifying the permissions when you load documents, you can assign default permissions to the LoadsStuff user or the WritesStuff role.