mirror of
https://github.com/lingble/chatwoot.git
synced 2025-11-01 19:48:08 +00:00
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(() => {
|
||||
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(() => {
|
||||
|
||||
@@ -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],
|
||||
},
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user