Loading TOC...

MarkLogic 9 Product Documentation
xdmp.nodeQueryRolesets

xdmp.nodeQueryRolesets(
   uri as String,
   root as Node,
   [insert-options as Object?],
   [options as String[]]
) as Sequence

Summary

Return a sequence of query-rolesets that are required for proper querying with Element Level Security if the node is inserted into the database with the given document-insert options. A typical workflow calls this function and adds each query-rolesets through the sec:add-query-rolesets function before inserting the document into the database so that the document can be correctly queried with Element Level Security as soon as it is inserted.

Parameters
uri The URI to be used when the document is inserted later.
root The root node. The root node can be an element node, an object node or an array node.
insert-options Options from the xdmp.documentInsert function.
options Other options. The default is ().

Options include:

"all"
Return all query-rolesets, even if they are already configured.
"unconfigured"
Return only those query-rolesets that are not configured.

Required Privileges

http://marklogic.com/xdmp/privileges/node-query-rolesets

Usage Notes

If neither "all" nor "unconfigured" is present, it defaults to "unconfigured".

Example

xdmp.nodeQueryRolesets(
    "/example.json", {"foo":"aaa"}, null, ["new"])

Example

xdmp.nodeQueryRolesets(
     "/example.json",
     {"foo":"aaa"},
     {"permissions" : xdmp.documentGetPermissions("foo.json")})

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