Menu item click¶
Each menu link in the side and top menus posts to the MenuItemClick page handler with the target application and page. The handler turns the post into a navigation.
| Field | Value |
|---|---|
| Operation ID | OP-09 |
| Trigger | POST to the MenuItemClick handler |
| Inputs | targetApp, targetPage |
| Outputs | Redirect result |
| Primary components | BolMenuModel.OnPostMenuItemClick, BolMenuModel.OnNavigate |
| Entry point | src/BolMiddleware/Models/BolMenuModel.cs |
Steps¶
- Build
NavigationOptionsfrom the postedtargetAppandtargetPage. - Call the virtual
OnNavigatehook so the consumer can adjust the options. - Run Navigate, which saves the context (BR-BOLMIDDLEWARE-002) and returns the redirect.
Process flow¶
The following diagram visualizes this operation's control flow.
flowchart TD
Start([POST MenuItemClick]) --> S1[Build NavigationOptions]
S1 --> S2[OnNavigate hook]
S2 --> S3[Navigate]
S3 --> EndOk([Redirect])
Failure and edge-case behavior¶
- The redirect target is built from posted values with no allow-list, so a crafted post can redirect to an arbitrary application and page.
- Anti-forgery validation is disabled on the page class, so the post can be forged cross-site.
Related documentation¶
- Index
- Overview
- Architecture
- Dependencies
- Configuration
- Operations and processes
- Business rules
- Security and authorization
- Service registration
- API reference
Sources¶
- src/BolMiddleware/Models/BolMenuModel.cs
- src/BolMiddleware/Contracts/NavigationOptions.cs
- src/BolMiddleware/Pages/Shared/_BolMenuItemPartial.cshtml