Skip to content

Load a user's group memberships

Loads the security-group memberships recorded for one user, or all memberships when no user is supplied. This operation carries a known inverted-branch defect in its parameter binding.

Field Value
Operation ID OP-MENU-09
Trigger Caller requests GetMenuSecurityUserForUser
Inputs IDataPortalInfo, menu user ID
Outputs Populated clsMenuSecurityUserCollection
Primary components clsMenuSecurityUserCollection.GetMenuSecurityUserForUser
Entry point SAIF.Business.Menu/clsMenuSecurityUserCollection.vb

Steps

  1. Build Criteria(dpi, menuUser).
  2. BeforeRetrieve: when MenuUser is non-empty it selects retrieveForUserSQL (SQL-030, WHERE MENU_USER = :MenuUser) — but the AddParm("MenuUser", …) call sits in the Else branch, so the parameterized statement is issued without its bind variable while the unfiltered statement (SQL-029) receives a superfluous parameter. (BR-MENU-001; table MENU_SECURITY_USER)
  3. On failure: this inverted-branch defect means the user-scoped path is expected to fail at execution (missing bind variable for :MenuUser).*
  4. AfterRetrieve loads one clsMenuSecurityUser per row.

Process flow

flowchart TD
    Start([GetMenuSecurityUserForUser]) --> Choice{MenuUser supplied?}
    Choice -->|Yes| ByUser[retrieveForUserSQL selected, but AddParm MenuUser is NOT called]
    Choice -->|No| All[Unfiltered statement selected, AddParm MenuUser called anyway]
    ByUser --> Exec1([Execution likely fails: missing bind variable])
    All --> Load[AfterRetrieve: Load each clsMenuSecurityUser]
    Load --> Done([Return populated collection])

Failure and edge-case behavior

  • User-scoped retrieval (MenuUser supplied): the parameterized SQL is issued without its bind variable — this is expected to fail at execution rather than return a filtered result.*
  • Unfiltered retrieval (MenuUser empty): a stray AddParm("MenuUser", …) call executes against a statement with no matching bind placeholder; behavior in that case is unconfirmed.**

Note: Statements marked with * were inferred from code structure, naming conventions, or contextual evidence where direct confirmation was not available in source artifacts.

Sources

  • SAIF.Business.Menu/clsMenuSecurityUserCollection.vb