
dls.documentAddPermissions( uri as String, permissions as Sequence ) as null
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.
// Adds the specified permissions to the list of permissions for the 'baz.xml'
// document.
const dls = require('/MarkLogic/dls');
declareUpdate();
dls.documentAddPermissions('/foo/bar/baz.xml',
[xdmp.permission('dls-user', 'read'),
xdmp.permission('dls-user', 'update')]);
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.