xdmp.defaultPermissions( [uri as String], [output-kind as String] ) as Object[]|Element[]
Returns the permissions any new document would get if the current user were to insert a document without specifying the default permissions.
// Retrieve the default permissions for a given URI, as objects: xdmp.defaultPermissions("http://example.com/content/foo.json") // Returns an array of JSON objects, such as the following: // // [{"permission" : {"capability" : "read", "roldId" : "324978243" }}, // {"permission" : {"capability" : "read", "roldId" : "32493478578243" }}, // {"permission" : {"capability" : "update", "roldId" : "32493478578243" }} ]
// Retrieve default permissions for the current user, as a // Sequence of XML elements xdmp.defaultPermissions(null, 'elements'); // Returns an array of element nodes such as the following: // // [<sec:permission xmlns:sec="http://marklogic.com/xdmp/security"> // <sec:capability>update</sec:capability> // <sec:role-id>8487823278258687528</sec:role-id> // </sec:permission>, // <sec:permission xmlns:sec="http://marklogic.com/xdmp/security"> // <sec:capability>update</sec:capability> // <sec:role-id>8487823278258687528</sec:role-id> // </sec:permission>]