MarkLogic 10 Product Documentation
dls:document-set-permissions

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

Summary

This function sets the specified permissions for the named document. Any unspecified permissions that were previously set for the document are removed.

Parameters
uri The URI of the document.
permissions The permissions to be set 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:
http://marklogic.com/xdmp/privileges/dls-user

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

Example

  xquery version "1.0-ml";

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

  dls:document-set-permissions("/foo/bar/baz.xml", 
                               (xdmp:permission("dls-user", "read"),
                                xdmp:permission("dls-user", "update"),
                                xdmp:permission("Developer", "read"),
                                xdmp:permission("Developer", "update")))

  (: Sets the permissions on the 'baz.xml' document. :)
    
Powered by MarkLogic Server | Terms of Use | Privacy Policy