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