MarkLogic 12 EA 1 Product Documentation
sec.privilegeSetName

sec.privilegeSetName(
   action as String,
   kind as String,
   new-privilege-name as String
) as null

Summary

Changes the sec:privilege-name of a sec:privilege to $new-privilege-name.

If a privilege with the given $action and $kind is not found, an error is returned.

If $new-privilege-name is not unique, an error is returned.

Parameters
action The action URI for the privilege. If $kind is a URI privilege, then use the URI to protect for the action parameter.
kind Either "execute" or "uri".
new-privilege-name The new name for the privilege.

Required Privileges

http://marklogic.com/xdmp/privileges/privilege-set-name

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');
   
sec.privilegeSetName(
    "http://marklogic.com/xdmp/privileges/mypriv", 
    "execute", 
    "new_name")

// Renames the execute privilege with the specified action to "new_name." 
Powered by MarkLogic Server | Terms of Use | Privacy Policy