
xdmp.nodeQueryRolesets( uri as String, root as Node, [insert-options as Object?], [options as String[]] ) as Sequence
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: 
  | 
	  
http://marklogic.com/xdmp/privileges/node-query-rolesets
If neither "all" nor "unconfigured" is present, it defaults to "unconfigured".
xdmp.nodeQueryRolesets(
    "/example.json", {"foo":"aaa"}, null, ["new"])
xdmp.nodeQueryRolesets(
     "/example.json",
     {"foo":"aaa"},
     {"permissions" : xdmp.documentGetPermissions("foo.json")})