
sec.pathAddPermissions( path as String, path-namespaces as element(sec.pathNamespace)[], permissions as element(sec.permission)[] ) as null
This function adds permissions for a protected path.
| Parameters | |
|---|---|
| path | The protected path. | 
| path-namespaces | The namespace(s) for the path. | 
| permissions | The permissions to add. | 
http://marklogic.com/xdmp/privileges/path-add-permissions
  This function must be executed against the Security database.
If the protected path has a path set, it can only have read permissions.
    declareUpdate(); 
    const sec = require('/MarkLogic/security');
    sec.pathAddPermissions("/a[b=1]/c",
                       sec.securityPathNamespace('ml', 'marklogic.com'),
                      [xdmp.permission("els-user-1", "update","element"), null, xdmp.permission("els-user-1", "update","element")])
      
  
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.