
sec.roleSetDefaultCollections( role-name as String, collections as String[] ) as null
Sets the default collections of a role with name $role-name to $collections.
| Parameters | |
|---|---|
| role-name | The name of a role. |
| collections | A sequence of collections. |
http://marklogic.com/xdmp/privileges/role-set-default-collections
If a role with name $role-name is not found, an error is raised.
This function must be executed against the security database.
// execute this against the security database
declareUpdate();
const sec = require('/MarkLogic/security.xqy');
sec.roleSetDefaultCollections("Developer",
("http://marklogic.com/dev_modules",
"http://marklogic.com/dev_docs"))
// Sets the default collections for the role, "Developer," to
"http://marklogic.com/dev_modules" and "http://marklogic.com/dev_docs".
Any other previously set collections are removed.