EnumRolesForUser

Returns the localized names of a user's roles.

Syntax

<HsvSecurityAccess>.EnumRolesForUser bstrUser, bstrLangId, pvarabstrRoleNames
ArgumentDescription
bstrUserString (ByVal). The user's security identifier.
bstrLangIdString (ByVal). The ID of the language in which to return the role names. Valid values are represented by the constants listed in Table 102, tagHFMDIMENSIONS Enumeration.
pvarabstrRoleNamesVariant array. Returns the localized role names. The array's subtype is String.

Example

The following function returns the English-language names of the connected user's roles.

Function GetUsersRolesEnglish() As Variant
Dim sSId As String, sName As String, cSecurity As HsvSecurityAccess
Dim vaRoles As Variant
'g_cSession represents an HsvSession instance
Set cSecurity = g_cSession.Security
cSecurity.GetConnectedUser2 sSId, sName
cSecurity.EnumRolesForUser sSId, CStr(HFM_LANGUAGE_ENGLISH), vaRoles
GetUsersRolesEnglish = vaRoles
End Function