Loading TOC...

MarkLogic 10 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".   

  

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