MarkLogic 9 Product Documentation
sec.userSetPassword

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

Summary

Changes the password for the user identified by $user-name to $password.

Parameters
user-name The name of the user.
password The new password. If $password is the empty string, an error is returned.

Required Privileges

http://marklogic.com/xdmp/privileges/user-set-password if the currrent user is not $user-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.userSetPassword("Jim", "temp")

// Changes the password for the user, "Jim," to "temp." 
   
Powered by MarkLogic Server | Terms of Use | Privacy Policy