Loading TOC...
Matches for cat:function (cat:function (cat:function/xquery)) have been highlighted. remove

MarkLogic Server 11.0 Product Documentation
sem:graph-get-permissions

sem:graph-get-permissions(
   $graph as sem:iri,
   [$format as xs:string]
) as element(sec:permission)*

Summary

Get permissions to the graph specified. The user must have read permissions on the graph.

This function is a built-in.

Parameters
graph The graph IRI.
$format Specify what format the result should be in. It can be either "elements" or "objects". With "elements", the built-in returns a sequence of XML elements. With "objects", the built-in returns a sequence of map:map. The default is "elements".

Example

xquery version "1.0-ml";
import module namespace sem = "http://marklogic.com/semantics" 
      at "/MarkLogic/semantics.xqy";
  
sem:graph-get-permissions(sem:iri("PlayerGraph"))

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

<sec:permission xmlns:sec="http://marklogic.com/xdmp/security">
<sec:capability>update</sec:capability>
<sec:role-id>5995163769635647336</sec:role-id>
</sec:permission>

(: the role ID 5995163769635647336 has read and update capability on this graph :)

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