Merge pull request #907 from Tria-plc/freight_feature/usermanagement

chnages
This commit is contained in:
marshal
2026-07-22 14:04:45 +03:00
committed by GitHub

View File

@@ -643,18 +643,6 @@ const filterSidebarByPermission = (
return true;
});
// Recursive: a group's own permission gates the whole subtree, leaves are
// checked individually, and a group with no surviving children disappears.
const filterItems = (items: SidebarItem[]): SidebarItem[] =>
items.flatMap((item) => {
if (item.children?.length) {
if (item.permission && !permissionAllowed(item)) return [];
const children = filterItems(item.children);
return children.length ? [{ ...item, children }] : [];
}
return itemAllowed(item) ? [item] : [];
});
return sections
.map((section) => ({
...section,