|
|
@ -55,9 +55,11 @@ function hasAnyRole(required, roles) { |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
function filterMenu(menuData, permissions, roles) { |
|
|
|
function filterMenu(menuData, permissions, roles) { |
|
|
|
menuData.forEach(menu => { |
|
|
|
menuData.forEach(menu => { |
|
|
|
menu.meta.invisible = !hasPermission(menu, permissions) && !hasRole(menu, roles) |
|
|
|
if (menu.meta && menu.meta.invisible === undefined) { |
|
|
|
if (menu.children && menu.children.length > 0) { |
|
|
|
menu.meta.invisible = !hasPermission(menu, permissions) && !hasRole(menu, roles) |
|
|
|
filterMenu(menu.children, permissions, roles) |
|
|
|
if (menu.children && menu.children.length > 0) { |
|
|
|
|
|
|
|
filterMenu(menu.children, permissions, roles) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|