This commit is contained in:
@@ -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 = {};
|
||||
|
||||
Reference in New Issue
Block a user