From eca2f34ba6f60a60679df1f475ddef05bcb00658 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Fri, 31 Jan 2020 22:54:07 +0000 Subject: [PATCH] --- ayanova/src/api/authutil.js | 3 ++- ayanova/src/api/initialize.js | 6 ++++-- ayanova/src/store.js | 3 +++ 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/ayanova/src/api/authutil.js b/ayanova/src/api/authutil.js index edd33851..060eefc1 100644 --- a/ayanova/src/api/authutil.js +++ b/ayanova/src/api/authutil.js @@ -36,7 +36,8 @@ export function processLogin(response) { authenticated: true, userId: Number(token.id), userName: token.name, - roles: token["ayanova/roles"] + roles: token["ayanova/roles"], + userType: token["usertype"] }); //Initialize the application diff --git a/ayanova/src/api/initialize.js b/ayanova/src/api/initialize.js index 63948289..d3805863 100644 --- a/ayanova/src/api/initialize.js +++ b/ayanova/src/api/initialize.js @@ -694,12 +694,14 @@ export default function initialize() { window.$gz.role.hasRole([ window.$gz.role.AUTHORIZATION_ROLES.CustomerFull, window.$gz.role.AUTHORIZATION_ROLES.CustomerLimited - ]) + ]) && + (window.$gz.store.userType == 4 || window.$gz.store.userType == 5) ) { //clear sublevel array sub = []; - //Set homePage in store to dashboard + //Set homePage in store to customer csr for this user type + window.$gz.store.commit("setHomePage", "/customer-csr-list"); //CSR LIST subitem diff --git a/ayanova/src/store.js b/ayanova/src/store.js index d8c06418..d8f681ce 100644 --- a/ayanova/src/store.js +++ b/ayanova/src/store.js @@ -17,6 +17,7 @@ export default new Vuex.Store({ userId: 0, userName: "NOT AUTHENTICATED", roles: 0, + userType: 0, homePage: undefined, localeText: {}, locale: { @@ -40,6 +41,7 @@ export default new Vuex.Store({ state.roles = data.roles; state.apiToken = data.apiToken; state.userName = data.userName; + state.userType = data.userType; }, logout(state) { //Things that are reset on logout @@ -48,6 +50,7 @@ export default new Vuex.Store({ state.userId = 0; state.userName = "NOT AUTHENTICATED"; state.roles = 0; + state.userType = 0; state.homePage = undefined; state.navItems = []; state.localeText = {};