Maintain a menu item together with its security-group assignments¶
Saves a menu item and its child security-group rows as one logical change.
| Field | Value |
|---|---|
| Operation ID | OP-MENU-003 |
| Trigger | Caller edits a menu item and its security groups. |
| Inputs | IDataPortalInfo, menu-item fields, security groups |
| Outputs | Persisted item and security rows |
| Primary components | clsMenuItem, clsMenuSecurityCollection |
| Entry point | SAIF.Business.Menu\clsMenuItem.vb |
Steps¶
- Create a new menu-item key with SQL-MENU-012 or load an existing item with SQL-MENU-015.
- Save the parent row through SQL-MENU-014 or SQL-MENU-016 against MENU_ITEM.
- Lazy-load child security groups with SQL-MENU-030 when the caller accesses
SecurityGroups. - Evaluate
IsValidandIsDirtyso the item inherits child state fromSecurityGroups(BR-MENU-005). - When the parent save succeeds and the child collection is dirty, create keys with SQL-MENU-024 and persist child rows with SQL-MENU-026 or SQL-MENU-028 against MENU_SECURITY. User-to-security-group membership rows in MENU_SECURITY_USER are maintained separately; see Maintain reference data.
- Delete obsolete rows with SQL-MENU-013 or SQL-MENU-025 as required, and rely on row-count checking after every write (BR-MENU-001).
Process flow¶
The following diagram visualizes this operation's control flow.
flowchart TD
Start([Caller edits menu item]) --> LoadItem[Create or retrieve item]
LoadItem --> EditItem[Change item fields]
EditItem --> LoadGroups[Load security groups]
LoadGroups --> Validate[Evaluate IsValid and IsDirty]
Validate --> PersistItem[Save MENU_ITEM]
PersistItem --> PersistGroups[Save dirty MENU_SECURITY rows]
PersistGroups --> Done([Return saved item])
Failure and edge-case behavior¶
- The child
SecurityGroupscollection can keep the parent item dirty even when the parent fields did not change (BR-MENU-005). - Unassigned items become public at read time because authorization treats missing security rows as unsecured (BR-MENU-002).
Related documentation¶
- Index
- Overview
- Architecture
- Dependencies
- Operations and processes
- Business rules
- Security and authorization
- Database tables
- SQL catalog
- API reference
Sources¶
SAIF.Business.Menu\clsMenuItem.vb