Loading TOC...

sec:unprotect-path

sec:unprotect-path(
   $path as xs:string,
   $path-namespaces as element(sec:path-namespace)*
) as empty-sequence()

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 :)
 
xquery version "1.0-ml"; 
import module namespace sec = "http://marklogic.com/xdmp/security" 
      at "/MarkLogic/security.xqy";

sec:unprotect-path("/root/bar[@baz=1]", ()),
sec:unprotect-path("test", ()),
sec:unprotect-path("/root/reg[fn:matches(@expr, 'is')]", ())
    

Example


 (: execute this against the Security database :)
 
xquery version "1.0-ml"; 
import module namespace sec = "http://marklogic.com/xdmp/security" 
      at "/MarkLogic/security.xqy";
	  
sec:unprotect-path("/root/bar[@baz=1]", (sec:security-path-namespace("ml", "marklogic.com")))

(: removes the protected path for the element in the ml namespace :)
   

Stack Overflow iconStack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.