Skip to main content

Securing MarkLogic Server

Protecting Your XQuery and JavaScript Code with Execute Privileges

To protect the execution of an individual XQuery or JavaScript function that you have written, you can use an execute privilege. When a function is protected with an execute privilege, a user must have that specific privilege to run the protected XQuery or JavaScript function.

Note

Execute privileges operate at the function level. To protect an entire XQuery or JavaScript document that is stored in a modules database, you can use execute permissions. For details, see Document Permissions.

This section describes how to protect your code with execute privileges.