This commit is contained in:
2021-11-19 00:43:09 +00:00
parent eb5f4b4fb6
commit fa1265422f
3 changed files with 29 additions and 20 deletions

View File

@@ -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;
},
/////////////////////////////////