Loading TOC...

sec:user-set-name

sec:user-set-name(
   $user-name as xs:string,
   $new-user-name as xs:string,
   $password as xs:string
) as empty-sequence()

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


xquery version "1.0-ml";
import module namespace sec="http://marklogic.com/xdmp/security" at 
    "/MarkLogic/security.xqy";

sec:user-set-name(
    "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.