fix: ignore subgroups without link when checking for permission (#10690)

This commit is contained in:
Shivam Mishra
2025-01-15 18:16:10 +05:30
committed by GitHub
parent 7fd8b4d03a
commit da488b0c32
2 changed files with 15 additions and 1 deletions

View File

@@ -40,7 +40,12 @@ const hasChildren = computed(
const accessibleItems = computed(() => {
if (!hasChildren.value) return [];
return props.children.filter(child => isAllowed(child.to));
return props.children.filter(child => {
// If a item has no link, it means it's just a subgroup header
// So we don't need to check for permissions here, because there's nothing to
// access here anyway
return child.to && isAllowed(child.to);
});
});
const hasAccessibleChildren = computed(() => {

View File

@@ -116,6 +116,15 @@ export default {
{
path: getPortalRoute(),
component: HelpCenterPageRouteView,
redirect: to => {
return {
name: 'portals_index',
params: {
navigationPath: 'portals_articles_index',
...to.params,
},
};
},
children: [...portalRoutes],
},
],