This commit is contained in:
@@ -51,7 +51,7 @@ export default {
|
||||
return false;
|
||||
}
|
||||
//array form?
|
||||
if (window.$gz._.isArray(desiredRole)) {
|
||||
if (Array.isArray(desiredRole)) {
|
||||
//it's an array of roles, iterate and if any are present then return true
|
||||
for (let i = 0; i < desiredRole.length; i++) {
|
||||
if ((window.$gz.store.state.roles & desiredRole[i]) != 0) {
|
||||
@@ -101,9 +101,19 @@ export default {
|
||||
let ret = this.defaultRightsObject();
|
||||
|
||||
//Get the type name from the type enum value
|
||||
let typeName = window.$gz._.findKey(window.$gz.type, function(o) {
|
||||
return o == oType;
|
||||
});
|
||||
//de-lodash
|
||||
// let typeName = window.$gz. _.findKey(window.$gz.type, function(o) {
|
||||
// return o == oType;
|
||||
// });
|
||||
|
||||
//my _.findKey replacement:
|
||||
let typeName = undefined;
|
||||
for (const [key, value] of Object.entries(window.$gz.type)) {
|
||||
if (value == oType) {
|
||||
typeName = key;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
//Get the AyaNova stock REQUIRED role rights for that object
|
||||
let objectRoleRights = this.ROLE_RIGHTS[typeName];
|
||||
|
||||
Reference in New Issue
Block a user