Loading TOC...

MarkLogic 9 Product Documentation
sec.addQueryRolesets

sec.addQueryRolesets(
   qrss as element(sec.queryRolesets)[]
) as Sequence

Summary

This function adds query rolesets to the Security database.

Parameters
qrss Query rolesets to be added

Required Privileges

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

Usage Notes

This function must be executed against the Security database.

Example


 // execute this against the Security database 
declareUpdate(); 
const sec = require('/MarkLogic/security.xqy');
	  
var roleset = sec.queryRolesets(sec.queryRoleset("els-role-2"));
sec.addQueryRolesets(roleset)
=>
11752102537381923938


Example


// execute this against the Security database 
declareUpdate();
const sec = require('/MarkLogic/security.xqy');
	  
var roleset1 = sec.queryRoleset("els-role-1");
var roleset2 = sec.queryRoleset("els-role-2");
sec.addQueryRolesets(sec.queryRolesets([roleset1,roleset2])) 
=>
12187562349380762165
    

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