Load the user's authorized menu¶
Constructs the NavigationContext that backs every subsequent menu-authorization check in the session. This is the only point in this library where Oracle is accessed, and it is delegated entirely to SAIF.Business.Menu.
| Field | Value |
|---|---|
| Operation ID | OP-MVC-06 |
| Trigger | First request of a session (step 5 of Initialize a request) |
| Inputs | User ID (upper-cased, trimmed) |
| Outputs | MenuAuthorizedItems collection cached for the session |
| Primary components | NavigationContext.New(inUser As String) |
| Entry point | SAIF.Presentation.Web.MVC/NavigationContext.vb |
Steps¶
- Construct
clsMSOracleDataLayerwith DB userMENUand the connection string fromAppGlobal.EnvironmentService.GetConfigSetting(EnvironmentConfigKeys.OracleDatabase)(BR-MVC-015). - Obtain
IDataPortalInfofrom the data layer. - Call
clsMenuAuthorizedItemCollection.GetMenuAuthorizedItems(dpi, user.Trim.ToUpper)(BR-MVC-015).
Origin: The authorized-item query itself — its SQL text and the Oracle menu tables it reads — is defined in
SAIF.Business.Menu, not in this library. See that library's own operations and SQL documentation for the query implementation. 4. Application codes and menu categories are loaded lazily on first property access and held inStaticlocals shared across all instances for the lifetime of the application domain (BR-MVC-018). - On first access within the process: a fresh load runs against Oracle. - On subsequent access: the cachedStaticvalue is returned without a database round trip.
Process flow¶
The following diagram visualizes this operation's control flow.
flowchart TD
Start([NavigationContext.New]) --> S1[Build clsMSOracleDataLayer as user MENU]
S1 --> S2[Obtain IDataPortalInfo]
S2 --> S3[GetMenuAuthorizedItems for user]
S3 --> S4{ApplicationCodes / MenuCategories accessed?}
S4 -->|First time| S5[Load from Oracle, cache in Static local]
S4 -->|Already cached| S6[Return cached value]
S5 --> EndOk([MenuAuthorizedItems cached in session])
S6 --> EndOk
Failure and edge-case behavior¶
- Because
ApplicationCodes/MenuCategoriesare cached at the application-domain level, a reference-data change requires a process recycle to take effect (BR-MVC-018). - The per-session
MenuAuthorizedItemsset, by contrast, is loaded fresh for every new session, so a user's grants can change between sessions without a recycle (BR-MVC-006).
Related documentation¶
Sources¶
- SAIF.Presentation.Web.MVC/NavigationContext.vb