listUserGroupsEx

[ Function ]

public static listUserGroupsEx(
    options?: object | null,
    requestOptions: TcHmi.Server.IRequestOptions | null = null,
    callback: null | ((this: void, data: TcHmi.Server.UserManagement.IGroupResultObject) => void) = null
): TcHmi.IErrorDetails;

Supplies a list of all existing system users as object with all metadata.

Parameter

Name

Type

Description

options

object, null

current unused

requestOptions

TcHmi.Server.IRequestOptions, null

Server request options

callback [ optional ]

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

listUserGroupsEx 1:

Available from version 1.10.1040.0

Sample - JavaScript

TcHmi.Server.UserManagement.listUserGroupsEx (
    null,
    {timeout: 2000},
    function(data) {
        if (data.error === TcHmi.Errors.NONE) {
            if (
                !data
                || !data.groupDetailsList
                || !data.groupDetailsList.__SystemGuests
            ) {
                // Error
                return;
            }
            // Are Guests able to fetch current user status?
            console.log(data.groupDetailsList.__SystemGuests.symbols.GetCurrentUser === TcHmi.Server.ACCESS.READWRITE);
            console.log(data.groupDetailsList);
/*
{
    "__SystemAdministrators": {
        "enabled": true,
        "fileAccess": 3,
        "files": {},
        "symbolAccess": 3,
        "symbols": {}
    },
    "__SystemGuests": {
        "enabled": true,
        "fileAccess": 0,
        "files": {},
        "symbolAccess": 0,
        "symbols": {
            "GetCurrentUser": 3,
            "IsAuthRequired": 3,
            "ListUserNames": 3,
            "Login": 3
        }
    } // and more…
}
*/
        } else {
            // Error
        }
    }
);