This commit is contained in:
2021-06-16 17:52:58 +00:00
parent 165d877b69
commit f1da826781
9 changed files with 57 additions and 29 deletions

View File

@@ -26,6 +26,9 @@ export default new Vuex.Store({
apiToken: "-",
downloadToken: "-",
tfaEnabled: undefined,
notifyAvailable: true,
isCustomerUser: false,
isSubContractorUser: false,
customerRights: {},
userId: 0,
userName: "NOT AUTHENTICATED",
@@ -69,10 +72,18 @@ 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.downloadToken = data.dlt;
state.tfaEnabled = data.tfaEnabled;
if (data.customerRights) {
state.customerRights = data.customerRights;
//only a customer user could have zero access to notifications
state.notifyAvailable =
data.customerRights.notifyServiceImminent == true ||
data.customerRights.notifyCSRAccepted == true ||
data.customerRights.notifyCSRRejected == true ||
data.customerRights.notifyWOCreated == true;
}
},
logout(state) {
@@ -86,6 +97,9 @@ export default new Vuex.Store({
state.userName = "NOT AUTHENTICATED";
state.roles = 0;
state.userType = 0;
state.notifyAvailable = true;
state.isCustomerUser = false;
state.isSubContractorUser = false;
state.homePage = undefined;
state.navItems = [];
state.translationText = {};