---
title: clsMenuSecurity
summary: API reference for clsMenuSecurity.
status: draft
owner: SAIF
last_reviewed: 2026-07-24
library: SAIF.Business.Menu
reference_type: package
---

# clsMenuSecurity

`clsMenuSecurity` is a BOF business object that associates a menu item with a security-group string value stored in the `MENU_SECURITY` table. This is a data record only; no security-framework enforcement occurs within this class.

## Purpose
- Persist and retrieve a single menu-security record linking a `MenuItemSeqNum` to a `SecurityGroup` string.
- Support sequence-based key generation, insert, update, and delete with contention checking per [BR-MNU-02](../../business-rules.md#br-mnu-02-dml-row-count-enforcement).

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

## Public members

| Member | Signature | Purpose |
| --- | --- | --- |
| `MenuSecuritySeqNum` | `Property MenuSecuritySeqNum As Decimal` | Primary key; generated via `MENU_SECURITY_SEQ` ([SQL-004](../../sql/SQL-004-saif-business-menu.md)).* |
| `MenuItemSeqNum` | `Property MenuItemSeqNum As Decimal` | Foreign key to `MENU_ITEM`.* |
| `SecurityGroup` | `Property SecurityGroup As String` | Security-group string tag (max 255 chars); plain data field, not an AD/WCF authorization call.* |
| `UpdateDate` | `Property UpdateDate As Date` | Last update date; set to `SYSDATE` on write.* |
| `UpdateUser` | `Property UpdateUser As String` | Last update user; bound from `DataPortalInfo.UserID` (max 30).* |

## Inherited public members

The members below are inherited from the BOF framework base class `clsBusinessBase` used by `clsMenuSecurity`.

| Member | Signature | Purpose |
| --- | --- | --- |
| `MyGuid` | `Public ReadOnly Property MyGuid() As String` | Returns the object's generated GUID identifier. |
| `IsNew` | `Public ReadOnly Property IsNew() As Boolean` | Indicates whether the object represents unsaved or newly created data. |
| `IsDeleted` | `Public ReadOnly Property IsDeleted() As Boolean` | Indicates whether the object is marked for deferred deletion. |
| `IsDirty` | `Public Overridable ReadOnly Property IsDirty() As Boolean` | Indicates whether the object has changed since it was loaded or saved. |
| `SetValueOnChange` | `Public Function SetValueOnChange(Of T)(ByRef inFieldValue As T, ByVal inSetValue As T, Optional ByVal inMarkDirty As Boolean = True) As Boolean` | Compares and assigns a field value, optionally marking the object dirty when the value changes. |
| `IsSavable` | `Public Overridable ReadOnly Property IsSavable() As Boolean` | Returns `True` only when the object is both dirty and valid. |
| `PreviousLinkItem` | `Public ReadOnly Property PreviousLinkItem() As ILinkItem` | Returns the previous item in the linked-list chain maintained by the framework. |
| `NextLinkItem` | `Public ReadOnly Property NextLinkItem() As ILinkItem` | Returns the next item in the linked-list chain maintained by the framework. |
| `SetPreviousLink` | `Public Sub SetPreviousLink(ByRef inLinkItem As ILinkItem)` | Sets the previous linked-list reference. |
| `SetNextLink` | `Public Sub SetNextLink(ByRef inLinkItem As ILinkItem)` | Sets the next linked-list reference. |
| `InsertLinkAfter` | `Public Sub InsertLinkAfter(ByRef inLinkItem As ILinkItem)` | Inserts another linked item immediately after the current item. |
| `InsertLinkBefore` | `Public Sub InsertLinkBefore(ByRef inLinkItem As ILinkItem)` | Inserts another linked item immediately before the current item. |
| `RemoveLinks` | `Public Sub RemoveLinks()` | Detaches the object from its linked-list neighbors. |
| `BeginEdit` | `Public Sub BeginEdit()` | Starts a nested edit session by snapshotting the object state. |
| `CancelEdit` | `Public Sub CancelEdit()` | Cancels the current edit session and restores the previous snapshot. |
| `ApplyEdit` | `Public Sub ApplyEdit()` | Commits the current edit session and accepts the edited state. |
| `Delete` | `Public Sub Delete()` | Marks a parent object for deletion during the next save operation. |
| `Clone` | `Public Function Clone() As Object` | Creates a cloned copy of the business object. |
| `ValidateOnDelete` | `Public Property ValidateOnDelete() As Boolean` | Controls whether business-rule validation also runs during delete saves. |
| `Rules` | `Public ReadOnly Property Rules() As clsRulesManager` | Exposes the framework rules manager for validation and message tracking. |
| `IsValid` | `Public Overridable ReadOnly Property IsValid() As Boolean` | Runs rule checking and reports whether the object is currently valid. |
| `ErrorCount` | `Public ReadOnly Property ErrorCount() As Integer` | Returns the number of current validation errors. |
| `ErrorMessages` | `Public ReadOnly Property ErrorMessages() As String()` | Returns the current validation error messages. |
| `WarningCount` | `Public ReadOnly Property WarningCount() As Integer` | Returns the number of current warning messages. |
| `WarningMessages` | `Public ReadOnly Property WarningMessages() As String()` | Returns the current warning messages. |
| `InformationalCount` | `Public ReadOnly Property InformationalCount() As Integer` | Returns the number of informational validation messages. |
| `InformationalMessages` | `Public ReadOnly Property InformationalMessages() As String()` | Returns the current informational messages. |
| `Save` | `Public Overridable Function Save() As Boolean` | Persists the object when it is valid and dirty. |
| `SaveChild` | `Public Overridable Function SaveChild() As Boolean` | Persists the object when it is operating as a child object. |
| `IsReadOnly` | `Public Overridable ReadOnly Property IsReadOnly() As Boolean` | Indicates whether the framework currently treats the object as read-only. |
| `XMLElementName` | `Public Property XMLElementName() As String` | Gets or sets the element name used when emitting XML. |
| `GetDataset` | `Public Sub GetDataset(ByRef inDS As DataSet)` | Adds the object data to the supplied `DataSet` using the default table name. |
| `GetDataset` | `Public Sub GetDataset(ByRef inDS As DataSet, ByVal inTableName As String)` | Adds the object data to the supplied `DataSet` using the specified table name. |
| `GetReportXML` | `Public Function GetReportXML(ByVal inElementName As String) As String` | Generates report-oriented XML using the supplied root element name. |
| `GetReportXML` | `Public Function GetReportXML() As String` | Generates report-oriented XML using the default element name. |
| `ToXml` | `Public Function ToXml() As String` | Serializes the object to XML using the configured or default tag name. |
| `ToXml` | `Public Function ToXml(ByVal inTagName As String) As String` | Serializes the object to XML using the supplied tag name. |

## Behavioral notes
- On `BeforeCreate`, executes [SQL-004](../../sql/SQL-004-saif-business-menu.md) to obtain `MenuSecuritySeqNum` from `MENU_SECURITY_SEQ`.
- On `BeforeInsert`, binds `MenuSecuritySeqNum`, `MenuItemSeqNum`, `SecurityGroup` (max 255), `UserId` (max 30); executes [SQL-010](../../sql/SQL-010-saif-business-menu.md).
- On `BeforeRetrieve`, binds `MenuSecuritySeqNum`; executes [SQL-026](../../sql/SQL-026-saif-business-menu.md).
- On `BeforeUpdate`, binds `MenuItemSeqNum`, `SecurityGroup` (max 255), `UserId` (max 30), `MenuSecuritySeqNum`; executes [SQL-036](../../sql/SQL-036-saif-business-menu.md).
- On `BeforeDelete`, binds `MenuSecuritySeqNum`; executes [SQL-043](../../sql/SQL-043-saif-business-menu.md).
- The nested `Criteria` class supports a lookup-by-`MenuItemSeqNum` overload used by `clsMenuSecurityCollection`.*
- All DML enforce [BR-MNU-02](../../business-rules.md#br-mnu-02-dml-row-count-enforcement).

## Constraints and usage notes
- `SecurityGroup` is a plain string data field; the actual authorization enforcement using this field is performed by a consuming presentation layer — see [BR-MNU-01](../../business-rules.md#br-mnu-01-menu-item-visibility-determined-by-security-group-or-user-mapping).

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

## Sources
- `Legacy\BusinessObjectFramework\clsBusinessBase.vb`
- `Business\SAIF.Business.Menu\clsMenuSecurity.vb`
