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

# clsMenuSecurityCollection

Loads security-group assignments for items.

## Purpose
- Provide all security rows or the subset for one item.
- Support duplicate checks inside maintenance flows.

## 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 inMenuSecuritySeqNum As Decimal) As clsMenuSecurity` | Looks up a security-group assignment in the loaded collection by its `MenuSecuritySeqNum` key, returning `Nothing` if no item matches. |
| CurrentItem | `Public Shadows ReadOnly Property CurrentItem() As clsMenuSecurity` | Returns the base collection's current item cast to `clsMenuSecurity`, avoiding caller-side casting when navigating a menu item's security-group assignments. |
| Save | `Public Overrides Function Save() As Boolean` | Persists the current object state through the SAIF data-portal lifecycle. |
| Add | `Public Shadows Function Add(ByVal inclsMenuSecurity As clsMenuSecurity) 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 inclsMenuSecurity As clsMenuSecurity) As Boolean` | Scans the loaded collection for an item whose `MenuSecuritySeqNum` equals the supplied object's `MenuSecuritySeqNum` (`clsMenuSecurity.Equals` compares only that sequence-number field). |
| Contains | `Public Overloads Function Contains(ByVal inMenuSecuritySeqNum As Decimal) As Boolean` | Scans the loaded collection for an item whose `MenuSecuritySeqNum` property equals the supplied value. |
| contains | `Public Overloads Function contains(ByVal inSecurityGroup As String) As Boolean` | Scans the loaded collection for an item whose `SecurityGroup` (trimmed, case-insensitive) equals the supplied security-group string. |
| ContainsDeleted | `Public Overloads Function ContainsDeleted(ByVal inclsMenuSecurity As clsMenuSecurity) As Boolean` | Scans the deleted-items list for an entry whose `MenuSecuritySeqNum` equals the supplied object's `MenuSecuritySeqNum`. |
| ContainsDeleted | `Public Overloads Function ContainsDeleted(ByVal inMenuSecuritySeqNum As Decimal) As Boolean` | Scans the deleted-items list for an entry matching the supplied sequence number, via `clsMenuSecurity.Equals(Object)`. |
| Remove | `Public Overloads Sub Remove(ByVal inMenuSecuritySeqNum As Decimal)` | Removes the security-group assignment matching the supplied key from the in-memory collection and moves it to the inherited deleted-items list so a subsequent `Save()` still issues the delete statement. |
| NewMenuSecurities | `Public Shared Function NewMenuSecurities(ByVal inDataportal As IDataPortalInfo) As clsMenuSecurityCollection` | Creates a new typed object using the supplied data-portal context. |
| GetAllMenuSecurities | `Public Shared Function GetAllMenuSecurities(ByVal inDataportal As IDataPortalInfo) As clsMenuSecurityCollection` | Retrieves the full typed set from Oracle. |
| GetMenuSecuritiesForItem | `Public Shared Function GetMenuSecuritiesForItem(ByVal inDataportal As IDataPortalInfo, ByVal inMenuItemSeqNum As Decimal) As clsMenuSecurityCollection` | Retrieves the `MENU_SECURITY` rows assigned to the menu item identified by `inMenuItemSeqNum`, producing the item's child security-group assignments loaded through `clsMenuItem.SecurityGroups`. |

## Behavioral notes
- Used by [BR-MENU-005](../../business-rules.md#br-menu-005-menu-item-validity-and-dirtiness-cascade-to-security-groups).

## Constraints and usage notes
- Collection wrapper around security rows.

## 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 clsMenuSecurity) (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 `clsMenuSecurity` rows outside `GetEnumerator`. | `clsBusinessCollection(Of T)` |
| Item | `Public Default ReadOnly Property Item(ByVal index As Integer) As clsMenuSecurity` | *Purpose could not be verified beyond the standard collection-indexer contract**; inferred usage is positional access to a loaded `clsMenuSecurity` row during indexed iteration or lookup-by-slot. | `clsBusinessCollection(Of T)` |
| GetEnumerator | `Public Function GetEnumerator() As IEnumerator(Of clsMenuSecurity)` | 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; consulted by `clsMenuItem.IsDirty` per [BR-MENU-005](../../business-rules.md#br-menu-005-menu-item-validity-and-dirtiness-cascade-to-security-groups).** | `clsBusinessCollection(Of T)` |
| IsValid | `Public Overridable ReadOnly Property IsValid() As Boolean` | Reports whether every loaded security-group row independently reports itself valid; consulted by `clsMenuItem.IsValid` per [BR-MENU-005](../../business-rules.md#br-menu-005-menu-item-validity-and-dirtiness-cascade-to-security-groups).** | `clsBusinessCollection(Of T)` |

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

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