Change password of a user since Vision Client

Hi, is there any form to change the password with my actual password in vision client?
Something like this ?

userSource = "default"  
username = system.security.getUsername()
oldPassword = event.source.parent.getComponent("txtOldPassword").text
newPassword = event.source.parent.getComponent("txtNewPassword").text


try:
    system.user.changePassword(userSource, username, oldPassword, newPassword)
    system.gui.messageBox("Contraseña cambiada exitosamente.")
except Exception as e:
    system.gui.errorBox("Error al cambiar la contraseña: " + str(e))

You might be looking for system.user.editUser(). The User object it takes has a password property that can be changed.