This commit is contained in:
@@ -114,11 +114,22 @@ export default {
|
||||
//get the logged in user's role
|
||||
let userRole = window.$gz.store.state.roles;
|
||||
|
||||
// console.log("Authorization roles getRights, userRole=", userRole);
|
||||
// console.log(
|
||||
// `Authorization roles getRights for ${typeName} objectRoleRights=`,
|
||||
// objectRoleRights
|
||||
// );
|
||||
|
||||
//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)
|
||||
let canChange = !!(userRole & objectRoleRights.Change);
|
||||
let canReadFullRecord = !!(userRole & objectRoleRights.ReadFullRecord);
|
||||
//sometimes rights to read are false if change is true since change trumps read anyway so accordingly:
|
||||
let canReadFullRecord = canChange;
|
||||
if (!canReadFullRecord) {
|
||||
//can't change but might have special rights to full record:
|
||||
canReadFullRecord = !!(userRole & objectRoleRights.ReadFullRecord);
|
||||
}
|
||||
|
||||
ret.change = canChange;
|
||||
ret.delete = ret.change; //FOR NOW
|
||||
@@ -132,6 +143,10 @@ export default {
|
||||
//
|
||||
canOpen(oType) {
|
||||
let r = this.getRights(oType);
|
||||
// //Am seeing where change is true but read is false, change trumps read so ...
|
||||
// if (r.change == true) {
|
||||
// return true;
|
||||
// }
|
||||
return r.read;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -174,6 +174,14 @@ function initNavPanel() {
|
||||
});
|
||||
}
|
||||
|
||||
//HISTORY / MRU / ACTIVITY (personal)
|
||||
sub.push({
|
||||
title: "History",
|
||||
icon: "fa-history",
|
||||
route: `/history/3/${window.$gz.store.state.userId}/true`,
|
||||
key: key++
|
||||
});
|
||||
|
||||
//SCHEDULE (personal)
|
||||
sub.push({
|
||||
title: "Schedule",
|
||||
|
||||
Reference in New Issue
Block a user