sec.unprotectPath

sec.unprotectPath(
   path as String,
   path-namespaces as element(sec.pathNamespace)[]
) as null

Summary

This function removes protection from the specified protected path, without removing the path itself from the Security database.

Parameters
path The name of the path.
path-namespaces The namespace(s) for the path.

Required Privileges

http://marklogic.com/xdmp/privileges/unprotect-path

Usage Notes

This function must be executed against the Security database.

Example


    // execute this against the security database
    declareUpdate();
    const sec = require('/MarkLogic/security.xqy');
       
    sec.unprotectPath("/root/bar[@baz=1]", []);
    sec.unprotectPath("test", []);
    sec.unprotectPath("/root/reg[fn:matches(@expr, 'is')]", []);
      

Example


    // execute this against the security database
    declareUpdate();
    const sec = require('/MarkLogic/security.xqy');
       
    sec.unprotectPath("/root/bar[@baz=1]", sec.securityPathNamespace("ml", "marklogic.com"));
    // removes the protected path for the element in the ml namespace
      
Powered by MarkLogic Server | Terms of Use | Privacy Policy