MarkLogic 12 EA 1 Product Documentation
sec.userSetName

sec.userSetName(
   user-name as String,
   new-user-name as String,
   password as String
) as null

Summary

Changes the name of the user from $user-name to $new-user-name.

Parameters
user-name The existing name of the user.
new-user-name The new name of the user.
password The password to set for the user. This can be either the original password for the user or a new password.

Required Privileges

http://marklogic.com/xdmp/privileges/user-set-name if the currrent user is not $user-name.

Usage Notes

If a user with name equal to $user-name is not found, an error is returned.

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

This function must be executed against the security database.

Example



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

sec.userSetName(
    "William",
    "Bill",
    "temp")
   
// Changes the username from "Wiiliam" to "Bill" and resets the password to
   "temp".   

  
Powered by MarkLogic Server | Terms of Use | Privacy Policy