Skip to content

Commit 5639949

Browse files
hotfix: initiatives menu item not visible to users without UserManagement permission (#1088)
The "Initiatives" item in the Management section of the side navigation was never visible to users who had the `Initiatives` permission but not the `UserManagement` permission (e.g. CMPSM, CSO, CPM roles). This was caused by conditional logic in `AsyncMenuService`. The `menuItems.Add(management)` call, which adds the Management section to the nav, was placed inside the `UserManagement` policy block. The `Initiatives` policy check sat outside that block (at the`Internal` level), but since the `management` object had never been added to `menuItems`, any items appended to it were silently discarded. ## PR Type - [ ] Feature - [x] Hotfix - [ ] Release - [ ] Documentation --- ## Checklist - [x] Code builds locally - [x] Tests added or updated - [x] CI is green - [ ] Peer review completed --- ### UAT - [x] Required → completed - [ ] Not required (explain below)
2 parents 2cc9b37 + d5e4b45 commit 5639949

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/Server.UI/Services/Navigation/AsyncMenuService.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,6 @@ public async Task<IEnumerable<MenuSectionModel>> GetFeaturesAsync(ClaimsPrincipa
122122
});
123123
}
124124

125-
menuItems.Add(management);
126125
}
127126

128127
if(await PassesPolicy(principal, SecurityPolicies.Initiatives))
@@ -137,6 +136,11 @@ public async Task<IEnumerable<MenuSectionModel>> GetFeaturesAsync(ClaimsPrincipa
137136
});
138137
}
139138

139+
if(management.SectionItems.Any())
140+
{
141+
menuItems.Add(management);
142+
}
143+
140144
}
141145

142146
return menuItems;

0 commit comments

Comments
 (0)