xdmp.parsePermission( perm as String, [output-kind as String] ) as Object|Element
Returns a permission object corresponding to the element or object given. This function is in particular useful for converting XQuery-style permissions (element) in JSON-style (object) permissions.
'use strict'; const permissionAsElement=xdmp.permission("admin","read","element"); xdmp.parsePermission(permissionAsElement,"object") => { "capability" : "read", "roleId" : "32497824353" }
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.