Loading TOC...


   $graph as sem:iri,
   $permissions as element(sec:permission)*
) as empty-sequence()


Add permissions to the graph specified. The user must have update or insert permissions on the graph.

This function is a built-in.

graph The graph IRI.
$permissions Security permission elements corresponding to the permissions for the document. If not supplied, the current user's default permissions are applied. The default value used for $permissions can be obtained by calling xdmp:default-permissions(). A document that is created by a non-admin user (that is, by any user who does not have the admin role) must have at least one update permission, otherwise the creation will throw an XDMP-MUSTHAVEUPDATE exception.


xquery version "1.0-ml";

  (xdmp:permission("my-role", "read"), 
   xdmp:permission("my-role", "update")))

Stack Overflow iconStack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.