dls.documentSetPermissions( uri as String, permissions as Sequence ) as null
This function sets the specified permissions for the named document. Any unspecified permissions that were previously set for the document are removed.
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.
// Sets the permissions on the 'baz.xml' document. const dls = require('/MarkLogic/dls'); dls.documentSetPermissions('/foo/bar/baz.xml', [xdmp.permission('dls-user', 'read'), xdmp.permission('dls-user', 'update'), xdmp.permission('Developer', 'read'), xdmp.permission('Developer', 'update')]);