MCPcopy Create free account
hub / github.com/apache/cloudstack / filterAsyncRouter

Function filterAsyncRouter

ui/src/store/modules/permission.js:44–58  ·  view source on GitHub ↗
(routerMap, apis)

Source from the content-addressed store, hash-verified

42}
43
44function filterAsyncRouter (routerMap, apis) {
45 const accessedRouters = routerMap.filter(route => {
46 if (hasAccessToRoute(apis, route)) {
47 if (route.children && route.children.length > 0) {
48 route.children = filterAsyncRouter(route.children, apis)
49 }
50 if (route.meta && route.meta.section) {
51 return hasAccessToSection(route)
52 }
53 return true
54 }
55 return false
56 })
57 return accessedRouters
58}
59
60const permission = {
61 state: {

Callers 1

GenerateRoutesFunction · 0.85

Calls 3

hasAccessToRouteFunction · 0.85
hasAccessToSectionFunction · 0.85
filterMethod · 0.45

Tested by

no test coverage detected