This commit is contained in:
Douglas Barone 2020-11-13 08:04:10 -04:00
parent 51d8bd886d
commit 537c6392fb

View File

@ -206,7 +206,7 @@ router.beforeEach(async (to, from, next) => {
}) })
else { else {
//TODO: improve user authorization //TODO: improve user authorization
const dontHaveAuthorization = const doNotHaveAuthorization =
(to.matched.some(record => record.meta.superAdmin) && (to.matched.some(record => record.meta.superAdmin) &&
!loggedUser.isSuperAdmin) || !loggedUser.isSuperAdmin) ||
(to.matched.some(record => record.meta.tokenCreator) && (to.matched.some(record => record.meta.tokenCreator) &&
@ -218,7 +218,7 @@ router.beforeEach(async (to, from, next) => {
(to.matched.some(record => record.meta.watcher) && (to.matched.some(record => record.meta.watcher) &&
!loggedUser.isWatcher) !loggedUser.isWatcher)
if (dontHaveAuthorization) if (doNotHaveAuthorization)
next({ next({
name: 'home', name: 'home',
params: { params: {