Loading TOC...

sec.roleSetDefaultPermissions

sec.roleSetDefaultPermissions(
   role-name as String,
   permissions as element(sec.permission)[]
) as null

Summary

Sets the default permissions for a role with name $role-name.

Parameters
role-name The name of the role to which the default permissions are set.
permissions New permissions. If the empty sequence is provided, deletes the existing permissions.

Required Privileges

http://marklogic.com/xdmp/privileges/role-set-default-permissions

Usage Notes

If a role with name $role-name is not found, an error is raised.

This function must be executed against the security database.

Example


// execute this against the security database

declareUpdate();
const sec = require('/MarkLogic/security.xqy');

sec.roleSetDefaultPermissions(
    "Developer",
     [xdmp.permission("security", "read","element"),
     xdmp.permission("security", "update","element")])

// Sets the default permissions for the "Developer" role to security(read) and
   security(update).  

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