Loading TOC...

MarkLogic 12 EA 1 Product Documentation
xdmp.documentGetPermissions

xdmp.documentGetPermissions(
   uri as String,
   [output-kind as String]
) as Object[]|Element[]

Summary

Returns the permissions to a given document.

Parameters
uri The document URI.
output-kind The output kind. 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".

Usage Notes

If the URI passed in doesn't exist, an empty array is returned.

Example

  xdmp.documentGetPermissions("chapter5.json")
  =>
  [
    {
      "permission" : {
        "capability" : "read",
        "roldId" : "324978243"
       }
    },
    {
      "permission" : {
        "capability" : "read",
        "roldId" : "32493478578243"
      }
    },
    {
      "permission" : {
        "capability" : "update",
        "roldId" : "32493478578243"
      }
    }
  ]

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