This commit is contained in:
2021-07-13 15:15:07 +00:00
parent 5aafca79d9
commit c457a478f7
3 changed files with 49 additions and 23 deletions

View File

@@ -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? Workorder modifications for restricted / low rights users
Roles who can see part costs: - Remove all costs from workorder for parts unless have inventory-limited, inventory, bizadminfull or Accounting roles
Inventory, Inventory restricted (read only), BizAdminFull, Accounting not sent over wire / populated
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 not shown as fields in UI of workorder anywhere
todo 3: - Remove sections from work order for low rights users as per below
1465 - several subcontractor / tech limited restriction features in this case
- 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 HYPOTHETICAL SCHEDULEABLE USER ROLE RIGHTS

View File

@@ -152,7 +152,7 @@
> >
</v-toolbar-title> </v-toolbar-title>
<v-spacer></v-spacer> <v-spacer></v-spacer>
<!-- v-if="$store.state.notifyAvailable" --> <!-- All users can see this, they may not be able to subscribe to notifications but they may see direct or system notifications for any account so this is always available -->
<template> <template>
<v-btn text icon to="/home-notifications" data-cy="notification"> <v-btn text icon to="/home-notifications" data-cy="notification">
<v-badge color="deep-purple" :value="newNotificationCount() > 0"> <v-badge color="deep-purple" :value="newNotificationCount() > 0">

View File

@@ -27,9 +27,6 @@ export default new Vuex.Store({
downloadToken: "-", downloadToken: "-",
tfaEnabled: undefined, tfaEnabled: undefined,
notifyAvailable: true, notifyAvailable: true,
isCustomerUser: false,
isSubContractorUser: false,
isScheduleableUser: false,
customerRights: {}, customerRights: {},
userId: 0, userId: 0,
userName: "NOT AUTHENTICATED", userName: "NOT AUTHENTICATED",
@@ -56,11 +53,44 @@ export default new Vuex.Store({
knownPassword: false, knownPassword: false,
newNotificationCount: 0 newNotificationCount: 0
}, },
// getters: { getters: {
// isOutsideUser: state => { /* User types:
// return state.userType == 3 || state.userType == 4; 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: { mutations: {
setLastClientVersion(state, data) { setLastClientVersion(state, data) {
state.lastClientVersion = data; state.lastClientVersion = data;
@@ -73,9 +103,6 @@ export default new Vuex.Store({
state.apiToken = data.apiToken; state.apiToken = data.apiToken;
state.userName = data.userName; state.userName = data.userName;
state.userType = data.userType; 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.downloadToken = data.dlt;
state.tfaEnabled = data.tfaEnabled; state.tfaEnabled = data.tfaEnabled;
if (data.customerRights) { if (data.customerRights) {
@@ -101,9 +128,6 @@ export default new Vuex.Store({
state.roles = 0; state.roles = 0;
state.userType = 0; state.userType = 0;
state.notifyAvailable = true; state.notifyAvailable = true;
state.isCustomerUser = false;
state.isSubContractorUser = false;
state.isScheduleableUser = false;
state.homePage = undefined; state.homePage = undefined;
state.navItems = []; state.navItems = [];
state.translationText = {}; state.translationText = {};