Loading TOC...


   $uri as xs:string,
   $permissions as item()*
) as empty-sequence()


This function adds the specified permissions for the named document. Any permissions that were previously set for the document are retained.

uri The URI of the document.
permissions The permissions to be added for the document. When run in an XQuery context, the permissions are a sequence of XML elements (sec:permission). When importing this module into a Server-Side JavaScript context, the permissions are an array of Objects.

Required Privileges

The dls-user role is required to run this function, or the privilege:

The document must specify dls-user(update) permission.


  xquery version "1.0-ml";

  import module namespace dls = "http://marklogic.com/xdmp/dls" 
      at "/MarkLogic/dls.xqy";

                               (xdmp:permission("dls-user", "read"),
                                xdmp:permission("dls-user", "update")))
  (: Adds the specified permissions to the list of permissions for the 'baz.xml'
     document. :)

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