This commit is contained in:
2020-12-05 00:34:08 +00:00
parent 376aeab6d2
commit 2ffbb9a30d
3 changed files with 114 additions and 148 deletions

View File

@@ -63,6 +63,16 @@ export default {
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
// form first loads
@@ -151,15 +161,12 @@ export default {
},
/////////////////////////////////
// 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) {
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;
//convention is change might be defined but not read so canOpen is true eitehr way
return r.change == true || r.read == true;
}
};
/*