fix: ignore subgroups without link when checking for permission (#10690)
This commit is contained in:
@@ -40,7 +40,12 @@ const hasChildren = computed(
|
|||||||
|
|
||||||
const accessibleItems = computed(() => {
|
const accessibleItems = computed(() => {
|
||||||
if (!hasChildren.value) return [];
|
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(() => {
|
const hasAccessibleChildren = computed(() => {
|
||||||
|
|||||||
@@ -116,6 +116,15 @@ export default {
|
|||||||
{
|
{
|
||||||
path: getPortalRoute(),
|
path: getPortalRoute(),
|
||||||
component: HelpCenterPageRouteView,
|
component: HelpCenterPageRouteView,
|
||||||
|
redirect: to => {
|
||||||
|
return {
|
||||||
|
name: 'portals_index',
|
||||||
|
params: {
|
||||||
|
navigationPath: 'portals_articles_index',
|
||||||
|
...to.params,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
},
|
||||||
children: [...portalRoutes],
|
children: [...portalRoutes],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|||||||
Reference in New Issue
Block a user