SAIF.Business.Menu business rules¶
This page captures the business rules enforced directly by SAIF.Business.Menu.
BR-MENU-001: Optimistic contention on write¶
| Field | Value |
|---|---|
| Statement | Every insert, update, and delete must affect exactly one row before the object commits its state transition. |
| Trigger | A CRUD-capable business object finishes an insert, update, or delete. |
| Enforcement | Each entity AfterInsert, AfterUpdate, and AfterDelete checks RowsAffected <> 1. |
| Outcome | Unexpected write counts surface as contention or insert-failed errors. |
| Tables | BUSONLINE_APPS_CODE MENU_CATEGORY_CODE MENU_ITEM MENU_PAGE MENU_SECURITY MENU_SECURITY_USER MENU_FAVORITE |
| SQL | SQL-MENU-001 SQL-MENU-002 SQL-MENU-004 SQL-MENU-007 SQL-MENU-008 SQL-MENU-010 SQL-MENU-013 SQL-MENU-014 SQL-MENU-016 SQL-MENU-019 SQL-MENU-020 SQL-MENU-022 SQL-MENU-025 SQL-MENU-026 SQL-MENU-028 SQL-MENU-031 SQL-MENU-032 SQL-MENU-033 SQL-MENU-037 SQL-MENU-038 SQL-MENU-040 |
| Source | SAIF.Business.Menu\clsApplicationCode.vbSAIF.Business.Menu\clsMenuCategoryCode.vbSAIF.Business.Menu\clsMenuFavorite.vbSAIF.Business.Menu\clsMenuItem.vbSAIF.Business.Menu\clsMenuPage.vbSAIF.Business.Menu\clsMenuSecurity.vbSAIF.Business.Menu\clsMenuSecurityUser.vb |
BR-MENU-002: Unsecured menu items are visible by default¶
| Field | Value |
|---|---|
| Statement | A menu item with no MENU_SECURITY row is treated as public and returned with UnsecuredFlag = 'Y'. |
| Trigger | The authorized-menu query evaluates an item with no security rows. |
| Enforcement | RetrieveSQL and RetrieveAllSQL execute a NOT EXISTS branch against MENU_SECURITY. |
| Outcome | Security restrictions are opt-in; missing security rows leave the item public. |
| Tables | MENU_ITEM MENU_SECURITY |
| SQL | SQL-MENU-043 SQL-MENU-044 |
| Source | SAIF.Business.Menu\clsMenuAuthorizedItemCollection.vb |
BR-MENU-003: Security-group matching is case-insensitive¶
| Field | Value |
|---|---|
| Statement | A secured menu item is authorized only when a user membership row matches an item group name case-insensitively. |
| Trigger | The authorized-menu query evaluates an item with assigned security rows. |
| Enforcement | The authorized-menu query joins MENU_SECURITY to MENU_SECURITY_USER with upper(USR.SECURITY_GROUP_TXT) = upper(SEC.SECURITY_GROUP_TXT). |
| Outcome | Group-name casing differences do not block access, but the user must belong to an assigned group. |
| Tables | MENU_SECURITY MENU_SECURITY_USER MENU_ITEM |
| SQL | SQL-MENU-043 SQL-MENU-044 |
| Source | SAIF.Business.Menu\clsMenuAuthorizedItemCollection.vb |
BR-MENU-004: Favorites are always included and ordered¶
| Field | Value |
|---|---|
| Statement | A user's active favorites are always added to the authorized-menu result set and the Favorites view sorts them by MenuOrder. |
| Trigger | A user-scoped authorized-menu query executes and the favorites view is exposed. |
| Enforcement | RetrieveSQL unions active favorites and Favorites sorts the in-memory subset. |
| Outcome | Favorite items remain visible until soft-deleted and are returned in display order. |
| Tables | MENU_FAVORITE MENU_ITEM MENU_PAGE |
| SQL | SQL-MENU-043 |
| Source | SAIF.Business.Menu\clsMenuAuthorizedItemCollection.vbSAIF.Business.Menu\clsMenuFavorite.vb |
BR-MENU-005: Menu-item validity and dirtiness cascade to security groups¶
| Field | Value |
|---|---|
| Statement | A menu item reports valid or clean only when its SecurityGroups child collection is also valid or clean. |
| Trigger | A caller validates or saves a clsMenuItem. |
| Enforcement | clsMenuItem.IsValid, IsDirty, and SaveMe() aggregate child state from SecurityGroups. |
| Outcome | Menu-item maintenance persists parent and child state as one logical unit. |
| Tables | MENU_ITEM MENU_SECURITY |
| SQL | SQL-MENU-014 SQL-MENU-016 SQL-MENU-024 SQL-MENU-026 SQL-MENU-028 SQL-MENU-030 |
| Source | SAIF.Business.Menu\clsMenuItem.vbSAIF.Business.Menu\clsMenuSecurityCollection.vb |
BR-MENU-006: Retrieve-all uses the UNSECURED wildcard sentinel¶
| Field | Value |
|---|---|
| Statement | The unfiltered authorized-menu query stamps public rows with MenuUser = 'UNSECURED', and Contains(userId, menuItem) treats the sentinel as a wildcard match. |
| Trigger | A caller builds the all-users menu snapshot or checks it for a user. |
| Enforcement | RetrieveAllSQL emits the sentinel and Contains(userId, menuItem) matches it. |
| Outcome | All-users snapshots can answer public-item lookups without requerying per user. |
| Tables | MENU_ITEM MENU_SECURITY |
| SQL | SQL-MENU-044 |
| Source | SAIF.Business.Menu\clsMenuAuthorizedItemCollection.vbSAIF.Business.Menu\clsMenuAuthorizedItem.vb |
Inherited business rules¶
No dependency-resolution.json was produced for this run, so the following inherited rules are a best-effort inference from typical SAIF BOF framework (clsBusinessBase / clsBusinessCollection) patterns observed elsewhere in this codebase, not a Legends CLI-sourced dependency lookup.** Every public entity in this library (clsApplicationCode, clsMenuAuthorizedItem, clsMenuCategoryCode, clsMenuFavorite, clsMenuItem, clsMenuPage, clsMenuSecurity, clsMenuSecurityUser) inherits clsBusinessBase, and every public collection (clsApplicationCodeCollection, clsMenuAuthorizedItemCollection, clsMenuCategoryCodeCollection, clsMenuFavoriteCollection, clsMenuItemCollection, clsMenuPageCollection, clsMenuSecurityCollection, clsMenuSecurityUserCollection) inherits clsBusinessCollection(Of T).
BR-INH-001: Dirty/valid state gates persistence¶
| Field | Value |
|---|---|
| Statement | A clsBusinessBase-derived object only attempts an insert/update through Save() when its inherited IsDirty state is true and its inherited IsValid state is true.** |
| Trigger | A caller invokes Save() on any entity or collection in this library. |
| Enforcement | Framework-level Save() logic in clsBusinessBase/clsBusinessCollection checks dirty/valid flags before issuing the data-portal request.** |
| Outcome | Unchanged or invalid objects do not generate unnecessary or unsafe database writes. |
| Origin | clsBusinessBase / clsBusinessCollection (SAIF.BOF.Framework)** |
| Source | Inferred from override patterns in SAIF.Business.Menu\clsMenuItem.vb, SAIF.Business.Menu\clsApplicationCode.vb, and sibling entity/collection files, which each override IsValid/IsDirty to layer local rules atop the inherited base behavior.** |
BR-INH-002: Collection membership tracks deleted rows separately¶
| Field | Value |
|---|---|
| Statement | Removing an item from a clsBusinessCollection(Of T)-derived collection moves it to an internal deleted-items list rather than discarding it, so a subsequent Save() can still issue the corresponding delete statement.** |
| Trigger | A caller calls Remove on any typed collection in this library. |
| Enforcement | Framework-level Remove/ContainsDeleted behavior in clsBusinessCollection(Of T).** |
| Outcome | Deleted child rows (for example, removed clsMenuSecurity rows under clsMenuItem.SecurityGroups) are still deleted from the database on save rather than merely disappearing from the in-memory collection. |
| Origin | clsBusinessCollection(Of T) (SAIF.BOF.Framework)** |
| Source | Inferred from the ContainsDeleted members exposed on every collection type in this library (e.g. clsMenuItemCollection.vb, clsMenuSecurityCollection.vb).** |
Related documentation¶
- Index
- Overview
- Architecture
- Dependencies
- Operations and processes
- Security and authorization
- Database tables
- SQL catalog
- API reference
Note: Statements marked with
**could not be confirmed; treat as unknown until verified.
Sources¶
SAIF.Business.Menu\clsApplicationCode.vbSAIF.Business.Menu\clsMenuAuthorizedItem.vbSAIF.Business.Menu\clsMenuAuthorizedItemCollection.vbSAIF.Business.Menu\clsMenuFavorite.vbSAIF.Business.Menu\clsMenuItem.vbSAIF.Business.Menu\clsMenuPage.vbSAIF.Business.Menu\clsMenuSecurity.vbSAIF.Business.Menu\clsMenuSecurityUser.vb