Loading TOC...

MarkLogic 9 Product Documentation
sec.pathSetPermissions

sec.pathSetPermissions(
   path as String,
   path-namespaces as element(sec.pathNamespace)[],
   permissions as element(sec.permission)[]
) as null

Summary

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.

Required Privileges

http://marklogic.com/xdmp/privileges/path-set-permissions

Usage Notes

This function must be executed against the Security database.

If the protected path has a path set, it can only have read permissions.

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:path-set-permissions("/root/bar[@baz=1]", (
<sec:path-namespace>
<sec:prefix>ml</sec:prefix>
<sec:namespace-uri>marklogic.com</sec:namespace-uri>
</sec:path-namespace>),
(xdmp:permission("els-role-1", "read"), xdmp:permission("els-role-1", "update"))
)
    

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