Returns the IDs of a user's or group's roles.
<HsvSecurityAccess>.EnumRolesForPrincipal bstrUserSID, pvaralRoleIds
Argument | Description |
---|---|
bstrUserSID | String (ByVal). The user’s or group's security identifier. |
pvaralRoleIds | Variant array. Returns the IDs of the assigned roles. Valid values are listed in Role ID Constants. The array's subtype is Long. |
The following function returns the roles for a given username.
Function GetPrincRolesFromName(sName As String) As Variant Dim cSecurity As HsvSecurityAccess, vaRoles As Variant Dim sSId As String 'g_cSession represents an HsvSession instance Set cSecurity = g_cSession.Security cSecurity.GetUserSID sName, sSId cSecurity.EnumRolesForPrincipal sSId, vaRoles GetPrincRolesFromName = vaRoles End Function