From 165d877b69ed84d4dc7e68748fffe3a837092589 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Wed, 16 Jun 2021 17:11:07 +0000 Subject: [PATCH] --- ayanova/src/api/initialize.js | 62 +++++++++++++++-------- ayanova/src/router.js | 9 ++++ ayanova/src/views/nofeaturesavailable.vue | 49 ++++++++++++++++++ 3 files changed, 98 insertions(+), 22 deletions(-) create mode 100644 ayanova/src/views/nofeaturesavailable.vue diff --git a/ayanova/src/api/initialize.js b/ayanova/src/api/initialize.js index ee58405b..cebac9b2 100644 --- a/ayanova/src/api/initialize.js +++ b/ayanova/src/api/initialize.js @@ -46,23 +46,38 @@ function initNavPanel() { //Set homePage in store to customer csr for this user type let CustomerHomePageSet = false; - //USER SETTINGS - sub.push({ - title: "UserSettings", - icon: "$ayiUserCog", - route: "/home-user-settings", - key: key++ - }); + //$store.state.customerRights + //{ "csr": true, "wo": true, "wowiki": true, "userSettings": true, "notifyServiceImminent": true, "notifyCSRAccepted": true, "notifyCSRRejected": true, "notifyWOCreated": true } - sub.push({ - title: "NotifySubscriptionList", - icon: "$ayiBullhorn", - route: "/home-notify-subscriptions", - key: key++ - }); + //USER SETTINGS + if (window.$gz.store.state.customerRights.userSettings == true) { + sub.push({ + title: "UserSettings", + icon: "$ayiUserCog", + route: "/home-user-settings", + key: key++ + }); + } + + if ( + window.$gz.store.state.customerRights.notifyServiceImminent == true || + window.$gz.store.state.customerRights.notifyCSRAccepted == true || + window.$gz.store.state.customerRights.notifyCSRRejected == true || + window.$gz.store.state.customerRights.notifyWOCreated == true + ) { + sub.push({ + title: "NotifySubscriptionList", + icon: "$ayiBullhorn", + route: "/home-notify-subscriptions", + key: key++ + }); + } //CSR LIST subitem - if (window.$gz.role.canOpen(window.$gz.type.CustomerServiceRequest)) { + if ( + window.$gz.role.canOpen(window.$gz.type.CustomerServiceRequest) && + window.$gz.store.state.customerRights.csr == true + ) { sub.push({ title: "CustomerServiceRequestList", icon: "$ayiConciergeBell", @@ -75,21 +90,24 @@ function initNavPanel() { } //WORKORDERS subitem - if (window.$gz.role.canOpen(window.$gz.type.WorkOrder)) { - sub.push({ - title: "WorkOrderList", - icon: "$ayiTools", - route: "/customer-workorders", - key: key++ - }); + if (window.$gz.store.state.customerRights.userSettings == true) { + if (window.$gz.role.canOpen(window.$gz.type.WorkOrder)) { + sub.push({ + title: "WorkOrderList", + icon: "$ayiTools", + route: "/customer-workorders", + key: key++ + }); + } } //** CUSTOMER LOGIN HOME (TOP) addNavItem("Home", "$ayiHome", undefined, sub, key++, "homecustomer"); //last resort home page if user has no roles set + //TODO: Needs to be no rights page, not user settings if (!CustomerHomePageSet) { - window.$gz.store.commit("setHomePage", "/home-user-settings"); + window.$gz.store.commit("setHomePage", "/no-rights"); } return; diff --git a/ayanova/src/router.js b/ayanova/src/router.js index cb614978..992999d4 100644 --- a/ayanova/src/router.js +++ b/ayanova/src/router.js @@ -856,6 +856,15 @@ export default new Router({ component: () => import(/* webpackChunkName: "evaluate" */ "./views/ay-evaluate.vue") }, + { + //No rights - happens when customer user logs in without access to anything at all due to configuration not allowing it + path: "/no-features-available", + name: "no-features-available", + component: () => + import( + /* webpackChunkName: "ay-common" */ "./views/nofeaturesavailable.vue" + ) + }, { //404 404 404 404 404 404 404 404 404 404 404 404 404 404 404 404 404 404 404 404 404 404 404 404 path: "*", diff --git a/ayanova/src/views/nofeaturesavailable.vue b/ayanova/src/views/nofeaturesavailable.vue new file mode 100644 index 00000000..caf2f39c --- /dev/null +++ b/ayanova/src/views/nofeaturesavailable.vue @@ -0,0 +1,49 @@ + + +