RemoveUserFromRole2

Removes a user from a role.

Syntax

<HsvSecurityAccess>.RemoveUserFromRole2 lRoleID, bstrUserSID

Argument

Description

lRoleID

Long (ByVal). The ID of the role from which to remove the user. For a list of valid role IDs, see Role ID Constants.

Tip:

To get a role’s ID from its name, use GetRoleID.

bstrUserSID

String (ByVal). The user’s security identifier.

Example

The following subroutine removes a user from a given role. The role name is passed to the subroutine, which uses GetRoleID to obtain the role ID.

Sub RemoveFromRole(sId As String, sRole As String)
Dim cSecurity As HsvSecurityAccess, lRoleID As Long
'g_cSession is an HsvSession object reference
Set cSecurity = g_cSession.Security
cSecurity.GetRoleID sRole, lRoleID
cSecurity.RemoveUserFromRole2 lRoleID, sId
End Sub