IsConnectedUserInRole

Indicates whether the connected user is assigned to a role.

Syntax

<HsvSecurityAccess>.IsConnectedUserInRole lRoleID, pbUserIsInRole

Argument

Description

lRoleID

Long (ByVal). The ID of the role to be tested. For a list of valid role IDs, see Role ID Constants.

pbUserIsInRole

Boolean. Returns TRUE if the connected user is assigned to the role, FALSE otherwise.

Example

This example tests whether the connected user is assigned to the Load System role. If IsConnectedUserInRole returns TRUE, any code placed within the If structure would be executed.

Dim lRoleID As Long, bInRole As Boolean
'g_cSecurity is an HsvSecurityAccess object reference
g_cSecurity.GetRoleID "Load System", lRoleID
g_cSecurity.IsConnectedUserInRole lRoleID, bInRole
If bInRole = True Then
  ...
End If