GetSecurityClassAccessForAllUsers2

Returns the access rights to a given security class for the current application’s users. GetSecurityClassAccessForAllUsers2 returns arrays of security identifiers, usernames, and access rights; the arrays have a one-to-one correspondence.

Syntax

<HFMwSecurity>.GetSecurityClassAccessForAllUsers2 lSecurityClassID, pvarabstrUserSIDs, pvarabstrUserNames, pvaralRights

Argument

Description

lSecurityClassID

The ID of the security class.

Tip:

To get the ID for a security class name, use GetSecurityClassID.

Input argument. Long subtype.

pvarabstrUserSIDs

Returns an array containing the users’ security identifiers.

Input/output argument.

pvarabstrUserNames

Returns an array containing the users’ usernames.

Input/output argument.

pvaralRights

Returns an array containing the users’ access rights to the security class.

Valid values are represented by the HFMConstants type library constants listed in Access Rights Constants.

Input/output argument.

Example

The following example prints an application’s usernames and their access rights to a given security class to the browser. The subroutine takes a security class name; the ID for this security class is obtained with GetSecurityClassID, and then passed to GetSecurityClassAccessForAllUsers2.

Sub printClassRights(sSecName)
Dim cHFMSecurity, lSecID, vaUserIDs, vaUserNames, vaRights
Dim sRight
Set cHFMSecurity = Server.CreateObject("Hyperion.HFMwSecurity")
' cHFMSession is a previously set HFMwSession object
cHFMSecurity.SetWebSession cHFMSession
lSecID = cHFMSecurity.GetSecurityClassID(sSecName)
cHFMSecurity.GetSecurityClassAccessForAllUsers2 lSecID, vaUserIDs, _ 
  vaUserNames, vaRights
For i = 0 to uBound(vaUserNames)
Select Case vaRights(i)
   Case HFM_ACCESS_RIGHTS_NONE
      sRight = "None"
   Case HFM_ACCESS_RIGHTS_READANDPROMOTE
      sRight = "Promote"
   Case HFM_ACCESS_RIGHTS_READONLY
      sRight = "Read"
   Case HFM_ACCESS_RIGHTS_ALL
      sRight = "All"
End Select
   Response.Write "<p>" & vaUserNames(i) & ": " & sRight & "</p>"
Next
End Sub