sec.getCollection( uri as String ) as element(sec.collection)
Gets the security document corresponding to a protected collection with uri equal to $uri.
Parameters | |
---|---|
uri | The URI of a collection. |
http://marklogic.com/xdmp/privileges/unprotect-collection
orhttp://marklogic.com/xdmp/privileges/collection-set-permissions
orhttp://marklogic.com/xdmp/privileges/collection-add-permissions
orhttp://marklogic.com/xdmp/privileges/collection-remove-permissions
If a protected collection with uri equal to $uri is not found, an error is raised.
This function must be executed against the security database.
// execute this against the security database // There is no JSON output for this function. const sec = require('/MarkLogic/security.xqy'); sec.getCollection("http://marklogic.com/cpf/domains") => <sec:collection xmlns:sec="http://marklogic.com/xdmp/security"> <sec:collection-id>403495114666638078</sec:collection-id> <sec:uri>http://marklogic.com/cpf/domains</sec:uri> </sec:collection>