
sec.pathSetPermissions( path as String, path-namespaces as element(sec.pathNamespace)[], permissions as element(sec.permission)[] ) as null
This function sets the permissions for a protected path.
| Parameters | |
|---|---|
| path | The protected path. |
| path-namespaces | The namespace(s) for the path. |
| permissions | The permissions to be set. |
http://marklogic.com/xdmp/privileges/path-set-permissions
This function must be executed against the Security database.
If the protected path has a path set, it can only have read permissions.
// execute this against the Security database
declareUpdate();
const sec = require('/MarkLogic/security');
sec.pathSetPermissions("/root/bar[@baz=1]",sec.securityPathNamespace('ml', 'marklogic.com'),
[xdmp.permission("els-role-1", "read","element"), xdmp.permission("els-role-1", "update","element")]);