TestUserInGroup - method of object Pm

Test if the user is or isn't a member of the user group.
TestUserInGroup(nType As Long, sGroups As String, [sUserId As String]) As Boolean
b = Pm.TestUserInGroup(nType, sGroup, sUserId)
nType(Long) Type of the tested user
0 - as a user the local user is used
1 - as a user the value of the sUserId parameter is used
sGroups(String) User groups identifiers list (separated with comma ',') where the user is searched.
sUserId[optional] (String) Identifier of the local or network user
Return Values:
true - the user is a member of any listed group
false - the user isn't a member of any listed group
If the designer creates a permissions system in the application based on logical user groups, then the method enables to test from a script if the logged-on (or else) user is a member of the group.
This method is not functional for Web panels in JavaScript language (and therefore it is not working in Web panels). Instead of this, it is possible to use the following for the Web panel:
- Call the user method of the PmPanel object (see the Methods page). The user information is not available directly from the client of the Web panel. Calling this method initiates communication with the server, the method is executed on the server, and via the pContext.User parameter it finds and returns the requested information. Calling this method returns the requested information after communication with the server.
Test if the local user is a member of the $OPER or $ADMIN group
VBScriptSelect and copy to clipboard

If Pm.TestUserInGroup(0, "$OPER,$ADMIN") Then
End If
PROMOTIC 8.3.30 SCADA system documentation - MICROSYS, spol. s r.o.

Send page remarkContact responsible person
- Pm
- Abs
- Cos
- E
- Exp
- LN2
- PI
- Pow
- Sin
- Tan
- TestUserInGroup
© MICROSYS, spol. s r. o.Tavičská 845/21 703 00 Ostrava-Vítkovice