listUserGroups
[ Function ]
public static listUserGroups(
callback: null | ((this: void, data: TcHmi.Server.UserManagement.IGroupResultObject) => void) = null
): TcHmi.IErrorDetails;
Supplies a list of all existing system groups as object with all metadata.
Parameter
Name | Type | Description |
---|---|---|
callback [ optional ] | (data: TcHmi.Server.UserManagement.IGroupResultObject) => void, null | Asynchronous callback function that is triggered once the action is completed. |
Return value
Type | Description |
---|---|
Returns confirmation as to whether the operation was successfully sent. |
Available from version 1.10.1171.21 |
Sample - JavaScript
TcHmi.Server.UserManagement.listUserGroups(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
}
});