Loading TOC...

MarkLogic Server 11.0 Product Documentation
sec:collection-get-permissions

sec:collection-get-permissions(
   $uri as xs:string
) as element(sec:permission)*

Summary

Returns a sequence of permission elements corresponding to the current permissions granted to the protected collection identified by $uri.

Parameters
uri The URI of a collection.

Required Privileges

http://marklogic.com/xdmp/privileges/collection-get-permissions

Usage Notes

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.

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:collection-get-permissions("http://marklogic.com/dev_modules")

=>
 
<sec:permission xmlns:sec="http://marklogic.com/xdmp/security">
  <sec:capability>read</sec:capability>
  <sec:role-id>5444982746628127945</sec:role-id>
</sec:permission>
<sec:permission xmlns:sec="http://marklogic.com/xdmp/security">
  <sec:capability>insert</sec:capability>
  <sec:role-id>5444982746628127945</sec:role-id>
</sec:permission>
  

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