Skip to content

clsMenuAuthorizedItemCollection

The central type of this library: resolves and holds the complete, denormalized set of menu items a specific user may reach, combining group-granted items, unsecured items, and the user's own favorites into one read-only projection (OP-MENU-01). SAIF.Presentation.Web.MVC's NavigationContext caches one instance per web session and uses its lookup/filter surface for every page-authorization check.

Purpose

  • Resolves the authorized-item set for one user (or, with an empty user, for every user) via the three-branch UNION query (BR-MENU-002 – BR-MENU-006).
  • Determines page reachability: FindPage returning Nothing is the authorization-denial signal consumed by the presentation layer (BR-MENU-008).
  • Normalizes page-link comparisons (trim, case-insensitive, query-string-stripped for non-exact lookups) across all of its lookup members (BR-MENU-009).
  • Treats the pseudo-user UNSECURED as matching any user in its membership test (BR-MENU-025).

Context

  • Namespace: SAIF.Business.Menu
  • Assembly/package: SAIF.Business.Menu (SAIF.BOF.Presentation.Web.Infragistics111 NuGet package)

Public members

Member Signature Purpose
GetMenuAuthorizedItems Shared Function GetMenuAuthorizedItems(dpi As IDataPortalInfo, menuUser As String) As clsMenuAuthorizedItemCollection Factory that resolves the authorized-item set for one user (BR-MENU-001, SQL-015); the primary entry point used by OP-MENU-01.
GetAllMenuAuthorizedItems Shared Function GetAllMenuAuthorizedItems(dpi As IDataPortalInfo) As clsMenuAuthorizedItemCollection Factory that resolves the authorized-item set across all users (SQL-016).
Item Default ReadOnly Property Item(menuItemSeqNum As Decimal) As clsMenuAuthorizedItem Linear search by menu-item sequence number.
Item Default ReadOnly Property Item(appCode As String, category As String, pageLink As String, [visibleOnly As Boolean]) As clsMenuAuthorizedItem Matches on application + category + page link, ignoring any query string (BR-MENU-009); honors visibleOnly (BR-MENU-010).
ItemExact Function ItemExact(appCode As String, category As String, pageLink As String, [visibleOnly As Boolean]) As clsMenuAuthorizedItem Same match as Item but the page link must match exactly, including any query string.
ItemByCategory Function ItemByCategory(category As String, pageLink As String, [visibleOnly As Boolean]) As clsMenuAuthorizedItem Category + link match across any application; tries an exact link match first, then falls back to a query-string-insensitive match (BR-MENU-011).
FindPage Function FindPage(appCode As String, pageLink As String) As clsMenuAuthorizedItem Link-only (query string stripped) page lookup within an application — the authorization predicate; Nothing means the page is not reachable by this user (BR-MENU-008, BR-MENU-009).
FindPageExact Function FindPageExact(appCode As String, pageLink As String) As clsMenuAuthorizedItem Full-link (including query string) page lookup within an application.
Favorites ReadOnly Property Favorites As clsMenuAuthorizedItemCollection Favorite rows only, sorted by MenuOrder (BR-MENU-005).
ApplicationItems ReadOnly Property ApplicationItems As clsMenuAuthorizedItemCollection Non-favorite rows.
AppItemsByCategory Function AppItemsByCategory(category As String) As clsMenuAuthorizedItemCollection Non-favorite rows in one category, matched case-insensitively; returns an empty collection for a Nothing category rather than raising an error (BR-MENU-027).
SecuredAppItems ReadOnly Property SecuredAppItems As clsMenuAuthorizedItemCollection Non-favorite rows that were granted through a security group, excluding both favorites and unsecured items (BR-MENU-026).
DumpAllMenuItemsToString Function DumpAllMenuItemsToString() As String Diagnostic dump of ApplicationPath.PageName for every row in the collection.
Contains Function Contains(item As clsMenuAuthorizedItem) As Boolean — 4 overloads (item; app + page seq; user + menu item; deleted-item variants) Membership tests; the user-scoped overload treats MenuUser = "UNSECURED" as matching any user (BR-MENU-025).

Inherited public members

Members in this section are inherited from clsBusinessCollectionBase in SAIF.Framework.Core (delivered by the SAIF.BOF.Framework package). They are available on this type through inheritance.

Member Signature Purpose Origin
First Sub First() Moves the collection's current-item cursor to the first element (ITraversion).† SAIF.Framework.Core — clsBusinessCollectionBase
Last Sub Last() Moves the cursor to the last element (ITraversion).† SAIF.Framework.Core — clsBusinessCollectionBase
Next Sub Next() Advances the cursor to the next element (ITraversion).† SAIF.Framework.Core — clsBusinessCollectionBase
Previous Sub Previous() Moves the cursor to the previous element (ITraversion).† SAIF.Framework.Core — clsBusinessCollectionBase
SetCurrent Sub SetCurrent(item As Object) Sets the cursor to the given item (ITraversion).† SAIF.Framework.Core — clsBusinessCollectionBase
Traverse Sub Traverse(...) Iterates the collection, applying a traversal callback to each element (ITraversion).† SAIF.Framework.Core — clsBusinessCollectionBase
Error ReadOnly Property Error As String Aggregated validation error message for the collection (IDataErrorInfo).† SAIF.Framework.Core — clsBusinessCollectionBase
Item(columnName) ReadOnly Property Item(columnName As String) As String Per-column validation error message (IDataErrorInfo).† SAIF.Framework.Core — clsBusinessCollectionBase

Behavioral notes

  • A missing or renamed column in the query result surfaces as a runtime error from AfterRetrieve rather than a handled business error*.
  • Requesting an unknown MenuUser yields an empty collection rather than an error, since no UNION branch matches.

Note: Statements marked with * were inferred from code structure, naming conventions, or contextual evidence where direct confirmation was not available in source artifacts. Statements marked with † were retrieved from dependency library documentation via the Legends CLI RAG service. They describe inherited behavior from the indicated origin library and should be verified if the dependency version changes.

Sources

  • SAIF.Business.Menu/clsMenuAuthorizedItemCollection.vb