fix permissions
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Lukas Bachschwell 2020-01-03 20:18:41 +01:00
parent 397b537b63
commit 3dd7aea121
Signed by: lbsadmin
GPG Key ID: CCC6AA87CC8DF425
2 changed files with 2 additions and 14 deletions

View File

@ -200,19 +200,12 @@ export const asyncRoutes = [
{ {
path: '/getincentives', path: '/getincentives',
component: Layout, component: Layout,
redirect: '/example/list',
name: 'Example Articles',
meta: {
title: 'Belohnungen',
icon: 'present',
roles: ['editor']
},
children: [ children: [
{ {
path: 'my', path: 'my',
component: () => import('@/views/incentives/list'), component: () => import('@/views/incentives/list'),
name: 'Belohnungen', name: 'Belohnungen',
meta: { title: 'Belohnungen', icon: 'star', roles: ['editor'] } meta: { roles: ['editor'], title: 'Belohnungen', icon: 'star' }
} }
] ]
}, },

View File

@ -49,12 +49,7 @@ const mutations = {
const actions = { const actions = {
generateRoutes({ commit }, roles) { generateRoutes({ commit }, roles) {
return new Promise(resolve => { return new Promise(resolve => {
let accessedRoutes const accessedRoutes = filterAsyncRoutes(asyncRoutes, roles)
if (roles.includes('admin')) {
accessedRoutes = asyncRoutes || []
} else {
accessedRoutes = filterAsyncRoutes(asyncRoutes, roles)
}
commit('SET_ROUTES', accessedRoutes) commit('SET_ROUTES', accessedRoutes)
resolve(accessedRoutes) resolve(accessedRoutes)
}) })