This commit is contained in:
@@ -5,8 +5,16 @@
|
|||||||
|
|
||||||
MISC ITEMS THAT CAME UP
|
MISC ITEMS THAT CAME UP
|
||||||
|
|
||||||
|
todo: Cust-User requires User rights but that's a big thing because it exposes
|
||||||
|
inside user to edit possibly
|
||||||
|
Need to carve a workaround I guess in the User route and objects
|
||||||
|
|
||||||
|
todo: No roles defined Users can login
|
||||||
|
Customer user with no roles can login and gets a CSR list screen
|
||||||
|
regular user with no roles can login and gets the evaluation screen
|
||||||
|
but shouldn't see that either or at least not be able to do anything serious there
|
||||||
|
Ideally they should be able to login and see their own home stuff and notifications and maybe memos, but nothing else
|
||||||
|
Initialize.js needs tweaking
|
||||||
|
|
||||||
|
|
||||||
todo: if list view not found / deleted when grid list form is opened rather than erroring with object/object it should
|
todo: if list view not found / deleted when grid list form is opened rather than erroring with object/object it should
|
||||||
@@ -35,14 +43,17 @@ todo: deleting customer must attempt to delete the following as they are entered
|
|||||||
|
|
||||||
todo: deleting HeadOffice must attempt to delete all contacts too
|
todo: deleting HeadOffice must attempt to delete all contacts too
|
||||||
|
|
||||||
|
todo: initialize.js is sketchy as hell, it replicates the entire role rights stuff essentially
|
||||||
|
it should be changed so that instead of checking for roles it should be checking for rights to individual items one by one
|
||||||
|
if it finds at least one item in the sub array for that group then it can make the container and insert the items
|
||||||
|
|
||||||
|
|
||||||
todo: No roles defined Users can login
|
|
||||||
Customer user with no roles can login and gets a CSR list screen
|
|
||||||
regular user with no roles can login and gets the evaluation screen
|
todo: Initialize has an expired license section that prevents all other options
|
||||||
but shouldn't see that either or at least not be able to do anything serious there
|
except fixing the license
|
||||||
Ideally they should be able to login and see their own home stuff and notifications and maybe memos, but nothing else
|
however I think this is supposed to switch to readonly mode in most cases unless it's a rental license?
|
||||||
Initialize.js needs tweaking
|
need to look into this, it's confusing what the intent is there
|
||||||
|
|
||||||
todo: Case 3595 Mass delete extension
|
todo: Case 3595 Mass delete extension
|
||||||
Do this early as it will be copied over and over again
|
Do this early as it will be copied over and over again
|
||||||
|
|||||||
@@ -63,6 +63,16 @@ export default {
|
|||||||
return (window.$gz.store.state.roles & desiredRole) != 0;
|
return (window.$gz.store.state.roles & desiredRole) != 0;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
//////////////////////////////////////////////////////////
|
||||||
|
// Does current logged in user have *ANY* role?
|
||||||
|
//
|
||||||
|
//
|
||||||
|
hasAnyRole() {
|
||||||
|
if (!window.$gz.store.state.roles || window.$gz.store.state.roles === 0) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
},
|
||||||
///////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////
|
||||||
// Get a default empty rights object so that it can be present when a
|
// Get a default empty rights object so that it can be present when a
|
||||||
// form first loads
|
// form first loads
|
||||||
@@ -151,15 +161,12 @@ export default {
|
|||||||
},
|
},
|
||||||
/////////////////////////////////
|
/////////////////////////////////
|
||||||
// convenience method for forms that deal with multiple object types
|
// convenience method for forms that deal with multiple object types
|
||||||
// (i.e. grids, history etc)
|
// (i.e. grids, history etc, initialization of main menu etc)
|
||||||
//
|
//
|
||||||
canOpen(oType) {
|
canOpen(oType) {
|
||||||
let r = this.getRights(oType);
|
let r = this.getRights(oType);
|
||||||
// //Am seeing where change is true but read is false, change trumps read so ...
|
//convention is change might be defined but not read so canOpen is true eitehr way
|
||||||
// if (r.change == true) {
|
return r.change == true || r.read == true;
|
||||||
// return true;
|
|
||||||
// }
|
|
||||||
return r.read;
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ function initNavPanel() {
|
|||||||
window.$gz.store.state.userType == 4;
|
window.$gz.store.state.userType == 4;
|
||||||
let isSubcontractorTypeUser = window.$gz.store.state.userType == 5;
|
let isSubcontractorTypeUser = window.$gz.store.state.userType == 5;
|
||||||
|
|
||||||
//Customer "outside user" options
|
//### ALL OUTSIDE TYPE USERS (CUSTOMER / HEADOFFICE) ###
|
||||||
if (isCustomerTypeUser) {
|
if (isCustomerTypeUser) {
|
||||||
//clear sublevel array
|
//clear sublevel array
|
||||||
sub = [];
|
sub = [];
|
||||||
@@ -84,9 +84,10 @@ function initNavPanel() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Non-customer ("inside user") options
|
//###### ALL INSIDE USERS FROM HERE DOWN ###############
|
||||||
|
|
||||||
|
//******* EXPIRED LICENSE BLOCK
|
||||||
|
|
||||||
//******* License issue
|
|
||||||
//Status NONE, EXPIREDTRIAL, EXPIREDPURCHASE, REVOKED
|
//Status NONE, EXPIREDTRIAL, EXPIREDPURCHASE, REVOKED
|
||||||
//only show license and logout
|
//only show license and logout
|
||||||
/* public enum LicenseStatus
|
/* public enum LicenseStatus
|
||||||
@@ -118,144 +119,91 @@ function initNavPanel() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//****************** HOME
|
//******* LICENSE OK, set up menu options for inside users...
|
||||||
//Most users except ops and client logins
|
|
||||||
if (
|
|
||||||
window.$gz.role.hasRole([
|
|
||||||
role.BizAdminFull,
|
|
||||||
role.BizAdminLimited,
|
|
||||||
role.DispatchFull,
|
|
||||||
role.DispatchLimited,
|
|
||||||
role.InventoryLimited,
|
|
||||||
role.InventoryFull,
|
|
||||||
role.AccountingFull,
|
|
||||||
role.TechLimited,
|
|
||||||
role.TechFull,
|
|
||||||
role.SubContractorLimited,
|
|
||||||
role.SubContractorFull,
|
|
||||||
role.SalesFull,
|
|
||||||
role.SalesLimited
|
|
||||||
])
|
|
||||||
) {
|
|
||||||
//DASHBOARD
|
|
||||||
//KPI / METRICS / CHARTS AND STUFF APPROPRIATE TO ROLE
|
|
||||||
sub.push({
|
|
||||||
title: "Dashboard",
|
|
||||||
icon: "$ayiTachometer",
|
|
||||||
route: "/home-dashboard",
|
|
||||||
key: key++
|
|
||||||
});
|
|
||||||
|
|
||||||
|
//####### HOME
|
||||||
|
|
||||||
|
//all inside users
|
||||||
|
|
||||||
|
//DASHBOARD
|
||||||
|
//KPI / METRICS / CHARTS AND STUFF APPROPRIATE TO ROLE
|
||||||
|
sub.push({
|
||||||
|
title: "Dashboard",
|
||||||
|
icon: "$ayiTachometer",
|
||||||
|
route: "/home-dashboard",
|
||||||
|
key: key++
|
||||||
|
});
|
||||||
|
|
||||||
|
//SEARCH
|
||||||
|
|
||||||
|
sub.push({
|
||||||
|
title: "Search",
|
||||||
|
icon: "$ayiSearch",
|
||||||
|
route: "/home-search",
|
||||||
|
key: key++
|
||||||
|
});
|
||||||
|
|
||||||
|
//HISTORY / MRU / ACTIVITY (personal)
|
||||||
|
sub.push({
|
||||||
|
title: "History",
|
||||||
|
icon: "$ayiHistory",
|
||||||
|
route: `/history/3/${window.$gz.store.state.userId}/true`,
|
||||||
|
key: key++
|
||||||
|
});
|
||||||
|
|
||||||
|
//SCHEDULE (personal)
|
||||||
|
sub.push({
|
||||||
|
title: "Schedule",
|
||||||
|
icon: "$ayiCalendarDay",
|
||||||
|
route: "/home-schedule",
|
||||||
|
key: key++
|
||||||
|
});
|
||||||
|
|
||||||
|
//MEMOS
|
||||||
|
sub.push({
|
||||||
|
title: "MemoList",
|
||||||
|
icon: "$ayiInbox",
|
||||||
|
route: "/home-memos",
|
||||||
|
key: key++
|
||||||
|
});
|
||||||
|
|
||||||
|
//REMINDERS (SCHEDULE MARKERS)
|
||||||
|
sub.push({
|
||||||
|
title: "ReminderList",
|
||||||
|
icon: "$ayiStickyNote",
|
||||||
|
route: "/home-reminders",
|
||||||
|
key: key++
|
||||||
|
});
|
||||||
|
|
||||||
|
//USER SETTINGS
|
||||||
|
sub.push({
|
||||||
|
title: "UserSettings",
|
||||||
|
icon: "$ayiUserCog",
|
||||||
|
route: "/home-user-settings",
|
||||||
|
key: key++
|
||||||
|
});
|
||||||
|
|
||||||
|
//USER NOTIFICATION SUBSCRIPTIONS
|
||||||
|
|
||||||
|
sub.push({
|
||||||
|
title: "NotifySubscriptionList",
|
||||||
|
icon: "$ayiBullhorn",
|
||||||
|
route: "/home-notify-subscriptions",
|
||||||
|
key: key++
|
||||||
|
});
|
||||||
|
|
||||||
|
//HOME
|
||||||
|
if (sub.length > 0) {
|
||||||
//Set homePage in store to dashboard
|
//Set homePage in store to dashboard
|
||||||
window.$gz.store.commit("setHomePage", "/home-dashboard");
|
window.$gz.store.commit("setHomePage", "/home-dashboard");
|
||||||
|
|
||||||
//SEARCH
|
|
||||||
if (
|
|
||||||
window.$gz.role.hasRole([
|
|
||||||
role.BizAdminFull,
|
|
||||||
role.BizAdminLimited,
|
|
||||||
role.DispatchFull,
|
|
||||||
role.DispatchLimited,
|
|
||||||
role.InventoryLimited,
|
|
||||||
role.InventoryFull,
|
|
||||||
role.AccountingFull,
|
|
||||||
role.TechLimited,
|
|
||||||
role.TechFull,
|
|
||||||
role.SalesFull,
|
|
||||||
role.SalesLimited
|
|
||||||
])
|
|
||||||
) {
|
|
||||||
sub.push({
|
|
||||||
title: "Search",
|
|
||||||
icon: "$ayiSearch",
|
|
||||||
route: "/home-search",
|
|
||||||
key: key++
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
//HISTORY / MRU / ACTIVITY (personal)
|
|
||||||
sub.push({
|
|
||||||
title: "History",
|
|
||||||
icon: "$ayiHistory",
|
|
||||||
route: `/history/3/${window.$gz.store.state.userId}/true`,
|
|
||||||
key: key++
|
|
||||||
});
|
|
||||||
|
|
||||||
//SCHEDULE (personal)
|
|
||||||
sub.push({
|
|
||||||
title: "Schedule",
|
|
||||||
icon: "$ayiCalendarDay",
|
|
||||||
route: "/home-schedule",
|
|
||||||
key: key++
|
|
||||||
});
|
|
||||||
|
|
||||||
//MEMOS
|
|
||||||
sub.push({
|
|
||||||
title: "MemoList",
|
|
||||||
icon: "$ayiInbox",
|
|
||||||
route: "/home-memos",
|
|
||||||
key: key++
|
|
||||||
});
|
|
||||||
|
|
||||||
//REMINDERS (SCHEDULE MARKERS)
|
|
||||||
sub.push({
|
|
||||||
title: "ReminderList",
|
|
||||||
icon: "$ayiStickyNote",
|
|
||||||
route: "/home-reminders",
|
|
||||||
key: key++
|
|
||||||
});
|
|
||||||
|
|
||||||
//USER SETTINGS
|
|
||||||
sub.push({
|
|
||||||
title: "UserSettings",
|
|
||||||
icon: "$ayiUserCog",
|
|
||||||
route: "/home-user-settings",
|
|
||||||
key: key++
|
|
||||||
});
|
|
||||||
|
|
||||||
//USER NOTIFICATION SUBSCRIPTIONS
|
|
||||||
if (
|
|
||||||
//all but subcontractors (arbitrary decision without any facts ;)
|
|
||||||
window.$gz.role.hasRole([
|
|
||||||
role.BizAdminFull,
|
|
||||||
role.BizAdminLimited,
|
|
||||||
role.DispatchFull,
|
|
||||||
role.DispatchLimited,
|
|
||||||
role.InventoryLimited,
|
|
||||||
role.InventoryFull,
|
|
||||||
role.AccountingFull,
|
|
||||||
role.TechLimited,
|
|
||||||
role.TechFull,
|
|
||||||
role.SalesFull,
|
|
||||||
role.SalesLimited
|
|
||||||
])
|
|
||||||
) {
|
|
||||||
sub.push({
|
|
||||||
title: "NotifySubscriptionList",
|
|
||||||
icon: "$ayiBullhorn",
|
|
||||||
route: "/home-notify-subscriptions",
|
|
||||||
key: key++
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
//HOME
|
|
||||||
addNavItem("Home", "$ayiHome", undefined, sub, key++, "home");
|
addNavItem("Home", "$ayiHome", undefined, sub, key++, "home");
|
||||||
}
|
}
|
||||||
|
|
||||||
//****************** CUSTOMERS
|
//######### CUSTOMERS
|
||||||
if (
|
if (window.$gz.role.canOpen(window.$gz.type.Customer)) {
|
||||||
window.$gz.role.hasRole([
|
|
||||||
role.BizAdminFull,
|
//these all require Customer rights so all in the same block
|
||||||
role.BizAdminLimited,
|
|
||||||
role.DispatchFull,
|
|
||||||
role.DispatchLimited,
|
|
||||||
role.TechFull,
|
|
||||||
role.TechLimited,
|
|
||||||
role.AccountingFull,
|
|
||||||
role.SalesFull,
|
|
||||||
role.SalesLimited
|
|
||||||
])
|
|
||||||
) {
|
|
||||||
//clear sublevel array
|
//clear sublevel array
|
||||||
sub = [];
|
sub = [];
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user