dls:document-add-permissions( $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.
dls-user
role is required to run this function, or the privilege:http://marklogic.com/xdmp/privileges/dls-user
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"; dls:document-add-permissions("/foo/bar/baz.xml", (xdmp:permission("dls-user", "read"), xdmp:permission("dls-user", "update"))) (: Adds the specified permissions to the list of permissions for the 'baz.xml' document. :)