Fixed import menu in pref side nav missing.

This commit is contained in:
Joseph Milazzo 2025-06-13 19:00:43 -05:00
parent 48a929c49d
commit 17f9328c8a
7 changed files with 35 additions and 14 deletions

View file

@ -273,13 +273,11 @@ export class PreferenceNavComponent implements AfterViewInit {
hasAnyChildren(user: User, section: PrefSection) {
// Filter out items where the user has a restricted role
const visibleItems = section.children.filter(item =>
item.restrictRoles.length === 0 || !this.accountService.hasAnyRole(user, item.restrictRoles)
(item.restrictRoles.length === 0 || !this.accountService.hasAnyRestrictedRole(user, item.restrictRoles)) &&
(item.roles.length === 0 || this.accountService.hasAnyRole(user, item.roles))
);
// Check if the user has any allowed roles in the remaining items
return visibleItems.some(item =>
this.accountService.hasAnyRole(user, item.roles)
);
return visibleItems.length > 0;
}
collapse() {