MarkLogic 9 Product Documentation
sem.graphGetPermissions

sem.graphGetPermissions(
   graph as sem.iri,
   [format as String]
) as Object[]

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 "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".

Example

var sem = require('/MarkLogic/semantics'); 

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

=>
[
 {
 "capability": "read",
 "roleId": "5995163769635647336"
 }
,
 {
 "capability": "update",
 "roleId": "5995163769635647336"
 }
]
//the role ID 5995163769635647336 has read and update capability on this graph
Powered by MarkLogic Server | Terms of Use | Privacy Policy