GetSecurityClassID

Returns the ID of the security class that has been assigned to an Intercompany Partner, given the Intercompany Partner’s member ID.

Syntax

<HsvICPs>.GetSecurityClassID lItemID, plSecurityClassID

Argument

Description

lItemID

Long (ByVal). The Intercompany Partner’s member ID.

plSecurityClassID

Long. Returns the ID of the Intercompany Partner’s security class, or SECURITY_CLASS_NONE if a security class has not been assigned to the Intercompany Partner.

Tip:

To get the label of the security class, pass the ID returned by this argument to the HsvSecurityAccess object’s GetSecurityClassLabel method.

Example

The following example creates a function that takes an Intercompany Partner’s label and returns the label of the Intercompany Partner’s security class, or a blank string if a security class has not been assigned to the Intercompany Partner. IHsvTreeInfo.GetItemID returns the Intercompany Partner’s member ID, which is then passed to GetSecurityClassID. If GetSecurityClassID indicates that the Intercompany Partner has no security class, a blank string is assigned as the function’s return value; otherwise, HsvSecurityAccess.GetSecurityClassLabel gets the security class’s label, which is then assigned as the function’s return value.

Function getICPSecLabel(sICPLabel As String) As String
Dim cICPs As HsvICPs, cTreeInfo As IHsvTreeInfo
Dim cSecurityAccess As HsvSecurityAccess
Dim lICPID As Long, lSecID As Long, sSecLabel As String
Set cICPs = m_cMetadata.ICPs
Set cTreeInfo = m_cMetadata.ICPs
lICPID = cTreeInfo.GetItemID(sICPLabel)
cICPs.GetSecurityClassID lICPID, lSecID
If lSecID < 0 Then
  getICPSecLabel = ""
Else
  Set cSecurityAccess = m_cSession.Security
  cSecurityAccess.GetSecurityClassLabel lSecID, sSecLabel
  getICPSecLabel = sSecLabel
End If
End Function