Creating an Execute Privilege
To create an execute privilege, follow these steps:
Click the Security icon in the left tree menu.
Click the Execute Privileges icon.
Click the Create tab. The New Execute Privilege page appears.
Enter the name of the execute privilege. Use a name that is descriptive of the action this execute privilege will protect. For example,
create-user
is the name of an execute privilege that gives a role the authorization to create a user.Enter a protected action, represented as a URI. You can use any URI but we recommend you follow the conventions for your company. For example, the URI for the
create-user
execute privilege ishttp://marklogic.com/xdmp/privileges/create-user
.Under the Roles section, select the roles that are allowed to perform the protected action.
Click OK.
The execute privilege is now added to the security database. You can now use the xdmp:security-assert()
function in your code to associate this privilege with a protected operation.