Fixed import menu in pref side nav missing.
This commit is contained in:
parent
48a929c49d
commit
17f9328c8a
7 changed files with 35 additions and 14 deletions
|
|
@ -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() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue