getGroupsOfCurrentUser

[ Function ]

public static getGroupsOfCurrentUser(): string[];

Returns the names of the groups to which the current user is assigned as a string array.

Parameter

Name

Type

Description

-

-

-

Return value

Type

Description

string[]

The names of the groups of the currently logged on user. This list can be empty.

getGroupsOfCurrentUser 1:

Available from 1.8

Sample - JavaScript

var userGroup = TcHmi.Server.getGroupsOfCurrentUser();
if(userGroup.length) {
    console.log('Current user is in groups ' + userGroup.join(', '));
} else {
    console.log('We have no current user group.');
}