Loading TOC...

xdmp:node-query-rolesets

xdmp:node-query-rolesets(
   $uri as xs:string,
   $root as node(),
   [$insert-options as (element()|map:map)?],
   [$options as xs:string*]
) as element(sec:query-rolesets)*

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:document-insert function. You can pass either an XML element node or a map:map.
$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:node-query-rolesets(
    "/example.xml", <foo>aaa</foo>, (), ("all"))

Example

xdmp:node-query-rolesets(
    "/example.xml",
    <foo>aaa</foo>,
    <options xmlns="xdmp:document-insert">
      <permissions>
        {xdmp:permission("role-1","read"),xdmp:permission("role-2","read")}
      </permissions>
    </options>)

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

Comments

The commenting feature on this page is enabled by a third party. Comments posted to this page are publicly visible.