This commit is contained in:
@@ -140,7 +140,9 @@ export default {
|
||||
//calculate the effective rights
|
||||
//a non zero result of the bitwise calculation means true and zero means false so using !! to force it into a boolean value
|
||||
//(contrary to some style guides that say !! is obscure but I say it saves a lot of typing)
|
||||
|
||||
const canChange = !!(userRole & objectRoleRights.Change);
|
||||
|
||||
//sometimes rights to read are false if change is true since change trumps read anyway so accordingly:
|
||||
let canReadFullRecord = canChange;
|
||||
if (!canReadFullRecord) {
|
||||
@@ -152,6 +154,13 @@ export default {
|
||||
ret.delete = ret.change; //FOR NOW
|
||||
ret.read = canReadFullRecord;
|
||||
|
||||
// console.log("authorizationroles::canOpen", {
|
||||
// typeName: typeName,
|
||||
// userRole: userRole,
|
||||
// objectRoleRights: objectRoleRights,
|
||||
// retResultIs: ret
|
||||
// });
|
||||
|
||||
return ret;
|
||||
},
|
||||
/////////////////////////////////
|
||||
|
||||
@@ -32,15 +32,15 @@ export default {
|
||||
UnitMeterReading: { Change: 33098, ReadFullRecord: 65669, Select: 131071 },
|
||||
Vendor: { Change: 33130, ReadFullRecord: 65669, Select: 131071 },
|
||||
TaskGroup: { Change: 10, ReadFullRecord: 131071, Select: 131071 },
|
||||
WorkOrderStatus: { Change: 10, ReadFullRecord: 131071, Select: 131071 },
|
||||
WorkOrderItemStatus: { Change: 1354, ReadFullRecord: 105093, Select: 131071 },
|
||||
WorkOrderStatus: { Change: 1354, ReadFullRecord: 98949, Select: 131071 },
|
||||
WorkOrderItemStatus: { Change: 1354, ReadFullRecord: 98949, Select: 131071 },
|
||||
WorkOrderItemPriority: {
|
||||
Change: 1354,
|
||||
ReadFullRecord: 105093,
|
||||
ReadFullRecord: 98949,
|
||||
Select: 131071
|
||||
},
|
||||
WorkOrder: { Change: 1994, ReadFullRecord: 105093, Select: 131071 },
|
||||
WorkOrderItem: { Change: 330, ReadFullRecord: 105093, Select: 131071 },
|
||||
WorkOrder: { Change: 1994, ReadFullRecord: 98949, Select: 131071 },
|
||||
WorkOrderItem: { Change: 330, ReadFullRecord: 98949, Select: 131071 },
|
||||
WorkOrderItemExpense: { Change: 458, ReadFullRecord: 98949, Select: 131071 },
|
||||
WorkOrderItemLabor: { Change: 1994, ReadFullRecord: 98949, Select: 131071 },
|
||||
WorkOrderItemLoan: { Change: 330, ReadFullRecord: 99461, Select: 131071 },
|
||||
|
||||
@@ -69,24 +69,24 @@ function initNavPanel() {
|
||||
}
|
||||
|
||||
//WORKORDERS subitem
|
||||
if (window.$gz.store.state.customerRights.userSettings == true) {
|
||||
if (window.$gz.role.canOpen(window.$gz.type.WorkOrder)) {
|
||||
sub.push({
|
||||
title: "WorkOrderList",
|
||||
icon: "$ayiTools",
|
||||
route: "/customer-workorders",
|
||||
key: key++
|
||||
});
|
||||
window.$gz.store.commit("setHomePage", "/customer-workorders");
|
||||
CustomerHomePageSet = true;
|
||||
}
|
||||
console.log(
|
||||
"Can open workorder role:",
|
||||
window.$gz.role.canOpen(window.$gz.type.WorkOrder)
|
||||
);
|
||||
|
||||
if (window.$gz.store.state.customerRights.wo == true) {
|
||||
sub.push({
|
||||
title: "WorkOrderList",
|
||||
icon: "$ayiTools",
|
||||
route: "/customer-workorders",
|
||||
key: key++
|
||||
});
|
||||
window.$gz.store.commit("setHomePage", "/customer-workorders");
|
||||
CustomerHomePageSet = true;
|
||||
}
|
||||
|
||||
//CSR LIST subitem
|
||||
if (
|
||||
window.$gz.role.canOpen(window.$gz.type.CustomerServiceRequest) &&
|
||||
window.$gz.store.state.customerRights.csr == true
|
||||
) {
|
||||
if (window.$gz.store.state.customerRights.csr == true) {
|
||||
sub.push({
|
||||
title: "CustomerServiceRequestList",
|
||||
icon: "$ayiConciergeBell",
|
||||
|
||||
Reference in New Issue
Block a user