<?xml version="1.0" encoding="UTF-8"?><api:function-page xml:base="/apidoc/8.0/sem.graphGetPermissions.xml" generated="2015-10-07T16:36:00.016766-07:00" mode="javascript" xmlns:api="http://marklogic.com/rundmc/api"><api:function-name>sem.graphGetPermissions</api:function-name><api:suggest>sem.graphgetpermissions</api:suggest><api:suggest>sem</api:suggest><api:suggest>graphgetpermissions</api:suggest><api:function-link mode="xquery" fullname="sem:graph-get-permissions">/apidoc/8.0/sem:graph-get-permissions.xml</api:function-link><api:function mode="javascript" name="graphGetPermissions" type="builtin" lib="sem" category="Semantics" hidden="false" bucket="MarkLogic Built-In Functions" prefix="sem" namespace="http://marklogic.com/semantics" fullname="sem.graphGetPermissions"><api:summary>
  Get permissions to the graph specified.
  The user must have read permissions on the graph.
  <p xmlns="http://www.w3.org/1999/xhtml">This function is a built-in.</p>
</api:summary><api:params><api:param name="graph" type="sem:iri"><api:param-description>
    The graph IRI.
  </api:param-description><api:param-name>graph</api:param-name><api:param-type>sem.iri</api:param-type></api:param><api:param class="javascript" name="format" type="xs:string" optional="true"><api:param-description>
    Specify what format the result should be in.
    It can be either "objects" or "elements".
    With "objects",  the built-in returns an array of objects.
    With "elements", the built-in returns an array of XML element nodes.
    The default is "objects".
  </api:param-description><api:param-name>format</api:param-name><api:param-type>String</api:param-type></api:param></api:params><api:return class="javascript">Object[]</api:return><api:example class="javascript"><pre xml:space="preserve" xmlns="http://www.w3.org/1999/xhtml">
var sem = require('/MarkLogic/semantics'); 

sem.graphGetPermissions(sem.iri("PlayerGraph"))

=&gt;
[
 {
 "capability": "read",
 "roleId": "5995163769635647336"
 }
,
 {
 "capability": "update",
 "roleId": "5995163769635647336"
 }
]
//the role ID 5995163769635647336 has read and update capability on this graph
</pre></api:example></api:function></api:function-page>