getApiAccess

[ Function ]

public static getApiAccess(
    options: TcHmi.Server.UserManagement.IUserManagementOptions | null,
    callback: null | ((this: void, data: TcHmi.Server.UserManagement. IApiAccessResultObject) => void) = null
): TcHmi.IErrorDetails;

Returns a list of user management functions (including parameters) the current system user is able to execute.

The general functionality of the respective API is shown here, including individual options.

Parameter

Name

Type

Description

options

TcHmi.Server.UserManagement.IUserManagementOptions, null

User management options

callback [ optional ]

(data: TcHmi.Server.UserManagement. IApiAccessResultObject) => 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.

getApiAccess 1:

Available from version 1.12

Sample - JavaScript

TcHmi.Server.UserManagement.getApiAccess(
    null,
    function(data) {
        if (data.error === TcHmi.Errors.NONE) {
            console.log(data.result);
/** Example output
{
    addUser: {
        general: true,
        enable: true,
        locale: true,
        timeFormatLocale: true,
        timeZone: false,
        autoLogoff: true,
        groups: true
    };
    listUserNames: {
        general: true
    };
    listUsers: {
        general: true,
        enabled: true,
        locale: true,
        timeFormatLocale: false,
        timeZone: true,
        autoLogoff: true,
        groups: false
    };
    listUserGroups: {
        general: true,
        enabled: true,
        fileAccess: true,
        files: true,
        symbolAccess: true,
        symbols: true
    };
    listUsersInGroup: {
        general: true
    };
    removeUser: {
        general: false
    };
    updateUser: {
        general: true,
        newName: true,
        addGroups: true,
        removeGroups: true,
        enabled: true,
        autoLogout: true,
        locale: false,
        timeFormatLocale: true,
        timeZone: true,
        changeOwnPassword: true,
        changePassword: true
    };
}
*/
        } else {
            // Error
        }
    }
);