updateUserEx

[ Function ]

public static updateUserEx(
    userName: string,
    options: TcHmi.Server.UserManagement.IUpdateUserDetails | null,
    requestOptions: TcHmi.Server.IRequestOptions | null = null,
    callback: null | ((this: void, data: TcHmi.IResultObject) => void) = null
): TcHmi.IErrorDetails;

Modifies a user.

Starting with version 1.12, users who are not members of the administrator group can change some of their data themselves.

Parameter

Name

Type

Description

userName

string

Name of the user

options

TcHmi.Server.UserManagement.IUpdateUserDetails, null

New details of the user. If a property is not set, it will not be changed.
The property "domain" cannot be changed, here it is only used for addressing.

requestOptions

TcHmi.Server.IRequestOptions, null

Server request options

callback [ optional ]

(data: TcHmi.IResultObject) => void, null

Asynchronous callback function that is triggered once the action is completed.

Return value

Type

Description

TcHmi.IErrorDetails

Returns confirmation as to whether the operation was successfully sent.

updateUserEx 1:

Available from version 1.10.1018.48

Sample - JavaScript

TcHmi.Server.UserManagement.updateUserEx(
    'myUser',
    {
        domain: 'myDomain', // Only for adressing, not changeable
        enabled: false,
        newName: 'myNewName',
        password: 'myNewPassword',
        autoLogout: 'PT42S',
        locale: 'fr',
        addGroups: ['myGroup1', 'myGroup2'],
        removeGroups: ['notMyGroup1', 'notMyGroup2']
    },
    {timeout: 2000},
    function(data) {
        if (data.error === TcHmi.Errors.NONE) {
            // Success
        } else {
            // Error
        }
    }
);