diff --git a/ayanova/devdocs/todo.txt b/ayanova/devdocs/todo.txt
index 41a24b02..965740bf 100644
--- a/ayanova/devdocs/todo.txt
+++ b/ayanova/devdocs/todo.txt
@@ -419,16 +419,18 @@ todo: many biz objects are not using new PUT methodology
########################################################################################################################
-CURRENTLY DOING: determine who sees part costs, then implement that and the scheduleable user role rights block below for contractors / tech limited etc
+CURRENTLY DOING:
-todo: Who can see part costs?
- Roles who can see part costs:
- Inventory, Inventory restricted (read only), BizAdminFull, Accounting
- If a tech or anyone needs to see part costs they can be given inventory restricted role meaning they can view the inventory and costs but cannot change anything related to inventory
+Workorder modifications for restricted / low rights users
+- Remove all costs from workorder for parts unless have inventory-limited, inventory, bizadminfull or Accounting roles
+ not sent over wire / populated
+ not shown as fields in UI of workorder anywhere
-todo 3:
- 1465 - several subcontractor / tech limited restriction features in this case
-
+- Remove sections from work order for low rights users as per below
+
+- go over initialize.js and for low rights roles restrict as per below
+
+- Test login as each low rights type and confirm works as planned below
HYPOTHETICAL SCHEDULEABLE USER ROLE RIGHTS
diff --git a/ayanova/src/App.vue b/ayanova/src/App.vue
index f396d0e9..99d97025 100644
--- a/ayanova/src/App.vue
+++ b/ayanova/src/App.vue
@@ -152,7 +152,7 @@
>
-
+
diff --git a/ayanova/src/store.js b/ayanova/src/store.js
index 04e0a72e..7da1b1c9 100644
--- a/ayanova/src/store.js
+++ b/ayanova/src/store.js
@@ -27,9 +27,6 @@ export default new Vuex.Store({
downloadToken: "-",
tfaEnabled: undefined,
notifyAvailable: true,
- isCustomerUser: false,
- isSubContractorUser: false,
- isScheduleableUser: false,
customerRights: {},
userId: 0,
userName: "NOT AUTHENTICATED",
@@ -56,11 +53,44 @@ export default new Vuex.Store({
knownPassword: false,
newNotificationCount: 0
},
- // getters: {
- // isOutsideUser: state => {
- // return state.userType == 3 || state.userType == 4;
- // }
- // },
+ getters: {
+ /* User types:
+ Service = 1,
+ NotService = 2,
+ Customer = 3,
+ HeadOffice = 4,
+ ServiceContractor = 5
+ */
+ isCustomerUser: state => {
+ return state.userType == 3 || state.userType == 4;
+ },
+ isSubContractorUser: state => {
+ return state.userType == 5;
+ },
+ isScheduleableUser: state => {
+ return state.userType == 1 || state.userType == 5;
+ },
+ canSubscribeToNotifications: state => {
+ switch (state.userType) {
+ case 1:
+ case 2:
+ return true;
+ case 3:
+ case 4:
+ //customer / headoffice and some notifications are enabled for them
+ return (
+ state.customerRights.notifyServiceImminent == true ||
+ state.customerRights.notifyCSRAccepted == true ||
+ state.customerRights.notifyCSRRejected == true ||
+ state.customerRights.notifyWOCompleted == true ||
+ state.customerRights.notifyWOCreated == true
+ );
+ case 5: //subcontractor for now no notification subscriptions available
+ return false;
+ }
+ return false;
+ }
+ },
mutations: {
setLastClientVersion(state, data) {
state.lastClientVersion = data;
@@ -73,9 +103,6 @@ export default new Vuex.Store({
state.apiToken = data.apiToken;
state.userName = data.userName;
state.userType = data.userType;
- state.isSubContractorUser = data.userType == 5;
- state.isCustomerUser = data.userType == 3 || data.userType == 4;
- state.isScheduleableUser = data.userType == 1 || data.userType == 5;
state.downloadToken = data.dlt;
state.tfaEnabled = data.tfaEnabled;
if (data.customerRights) {
@@ -101,9 +128,6 @@ export default new Vuex.Store({
state.roles = 0;
state.userType = 0;
state.notifyAvailable = true;
- state.isCustomerUser = false;
- state.isSubContractorUser = false;
- state.isScheduleableUser = false;
state.homePage = undefined;
state.navItems = [];
state.translationText = {};