---
title: "clsMenuSecurityUserCollection"
summary: "API reference for clsMenuSecurityUserCollection."
status: draft
owner: SAIF documentation team
last_reviewed: 2026-08-17
library: SAIF.Business.Menu
reference_type: package
---

# clsMenuSecurityUserCollection

Loads user-to-group memberships.

## Purpose
- Provide all membership rows or the subset for one user.
- Support collection membership and deleted-item checks.

## Context
- Namespace: `SAIF.Business.Menu`
- Assembly/package: `SAIF.Business.Menu.dll`

## Public members
| Member | Signature | Purpose |
| --- | --- | --- |
| Item (default, keyed) | `Default Public Overloads ReadOnly Property Item(ByVal inSecurityGroupTxt As String) As clsMenuSecurityUser` | Looks up a membership row in the loaded collection by its `SecurityGroupTxt` key, returning `Nothing` if no item matches. |
| CurrentItem | `Public Shadows ReadOnly Property CurrentItem() As clsMenuSecurityUser` | Returns the base collection's current item cast to `clsMenuSecurityUser`, avoiding caller-side casting when navigating a user's loaded group memberships. |
| Save | `Public Overrides Function Save() As Boolean` | Persists the current object state through the SAIF data-portal lifecycle. |
| Add | `Public Shadows Function Add(ByVal inclsMenuSecurityUser As clsMenuSecurityUser) As Integer` | Appends an already-constructed row to the in-memory collection so it participates in the next `Save()` and any collection-wide iteration, without issuing a retrieve. |
| Contains | `Public Overloads Function Contains(ByVal inclsMenuSecurityUser As clsMenuSecurityUser) As Boolean` | Scans the loaded collection for an item whose `SecurityGroupTxt` (trimmed, case-insensitive) equals the supplied object's `SecurityGroupTxt` (`clsMenuSecurityUser.Equals` compares only that field). |
| Contains | `Public Overloads Function Contains(ByVal inSecurityGroupTxt As String) As Boolean` | Scans the loaded collection for an item whose `SecurityGroupTxt` property equals the supplied security-group string. |
| ContainsDeleted | `Public Overloads Function ContainsDeleted(ByVal inclsMenuSecurityUser As clsMenuSecurityUser) As Boolean` | Scans the deleted-items list for an entry whose `SecurityGroupTxt` equals the supplied object's `SecurityGroupTxt`. |
| ContainsDeleted | `Public Overloads Function ContainsDeleted(ByVal inSecurityGroupTxt As String) As Boolean` | Scans the deleted-items list for an entry matching the supplied security-group string, via `clsMenuSecurityUser.Equals(Object)`. |
| Remove | `Public Overloads Sub Remove(ByVal inSecurityGroupTxt As String)` | Removes the membership row matching the supplied security-group name from the in-memory collection and moves it to the inherited deleted-items list so a subsequent `Save()` still issues the delete statement. |
| NewMenuSecurityUser | `Public Shared Function NewMenuSecurityUser(ByVal inDataportal As IDataPortalInfo) As clsMenuSecurityUserCollection` | Creates a new typed object using the supplied data-portal context. |
| GetMenuSecurityUserForUser | `Public Shared Function GetMenuSecurityUserForUser(ByVal inDataportal As IDataPortalInfo, ByVal inMenuUser As String) As clsMenuSecurityUserCollection` | Intended to retrieve `MENU_SECURITY_USER` membership rows for the user named by `inMenuUser`, but the underlying `retrieveForUserSQL` statement's `:MenuUser` bind variable is never supplied (see [SQL-MENU-035](../../sql/SQL-MENU-035-retrieve-menu-security-users-for-user.md)); this call fails rather than returning per-user memberships. |
| GetMenuSecurityUserAll | `Public Shared Function GetMenuSecurityUserAll(ByVal inDataportal As IDataPortalInfo) As clsMenuSecurityUserCollection` | Retrieves every `MENU_SECURITY_USER` row (all users' security-group memberships), unfiltered and unaffected by the `GetMenuSecurityUserForUser` binding defect. |

## Behavioral notes
- Feeds the data used by the authorized-menu join.
- `GetMenuSecurityUserForUser` selects the `retrieveForUserSQL` statement documented in [SQL-MENU-035](../../sql/SQL-MENU-035-retrieve-menu-security-users-for-user.md), but `BeforeRetrieve` does not bind the `:MenuUser` value on that code path. As written, calling `GetMenuSecurityUserForUser` fails at execution time (e.g., an Oracle missing-bind-variable error) rather than return the caller's per-user membership rows.

## Constraints and usage notes
- Collection wrapper around membership rows.
- Do not rely on `GetMenuSecurityUserForUser` to return per-user membership data until the `:MenuUser` binding defect described in [SQL-MENU-035](../../sql/SQL-MENU-035-retrieve-menu-security-users-for-user.md) is fixed in the source; `GetMenuSecurityUserAll` (unfiltered) is unaffected by this defect.

## Inherited public members

No `dependency-resolution.json` was produced for this run, so the members below are a best-effort inference from typical SAIF BOF framework (`clsBusinessCollection(Of T)`) patterns observed elsewhere in this codebase, not a Legends CLI-sourced dependency lookup.**

### From clsBusinessCollection(Of clsMenuSecurityUser) (SAIF.BOF.Framework)**

| Member | Signature | Purpose | Origin |
| --- | --- | --- | --- |
| Count | `Public ReadOnly Property Count() As Integer` | *Purpose could not be verified beyond the standard collection-indexer contract**; inferred usage is bounding `For` loops when callers iterate loaded `clsMenuSecurityUser` rows outside `GetEnumerator`. | `clsBusinessCollection(Of T)` |
| Item | `Public Default ReadOnly Property Item(ByVal index As Integer) As clsMenuSecurityUser` | *Purpose could not be verified beyond the standard collection-indexer contract**; inferred usage is positional access to a loaded `clsMenuSecurityUser` row during indexed iteration or lookup-by-slot. | `clsBusinessCollection(Of T)` |
| GetEnumerator | `Public Function GetEnumerator() As IEnumerator(Of clsMenuSecurityUser)` | Supports `For Each` iteration over the loaded collection.** | `clsBusinessCollection(Of T)` |
| IsDirty | `Public Overridable ReadOnly Property IsDirty() As Boolean` | Reports whether any loaded or deleted item in the collection has pending changes.** | `clsBusinessCollection(Of T)` |
| IsValid | `Public Overridable ReadOnly Property IsValid() As Boolean` | Reports whether every loaded item in the collection independently reports itself valid.** | `clsBusinessCollection(Of T)` |

> **Note:** Statements marked with `**` could not be confirmed; treat
> as unknown until verified.

## Sources
- `SAIF.Business.Menu\clsMenuSecurityUserCollection.vb`
