This commit is contained in:
2019-06-05 21:02:51 +00:00
parent 65967d4992
commit a6dabfe3ea
5 changed files with 71 additions and 23 deletions

View File

@@ -45,8 +45,19 @@ export default {
}
return (store.state.roles & desiredRole) != 0;
},
/////////////////////////////////
///////////////////////////////////////////////////////////////////////
// Get a default empty rights object so that it can be present when a
// form first loads
//
defaultRightsObject() {
return {
change: false,
read: false,
delete: false
};
},
/////////////////////////////////
// oType is the name of the object type as defined in ayatype.js
//
getRights(vm, oType) {
//from bizroles.cs:
@@ -58,11 +69,7 @@ export default {
//DELETE = SAME AS CHANGE FOR NOW (There is no specific delete right for now though it's checked for by routes in Authorized.cs in case we want to add it in future as a separate right from create.)
//NOTE: biz rules can supersede this, this is just for general rights purposes, if an object has restrictive business rules they will take precedence every time.
var ret = {
change: false,
read: false,
delete: false
};
var ret = this.defaultRightsObject();
//Get the type name from the type enum value
var typeName = _.findKey(vm.$gztype, function(o) {

View File

@@ -13,7 +13,6 @@ import Vue from "vue";
import errorHandler from "./errorhandler";
import store from "../store";
var triggeringChange = false;
function isEmpty(o) {

View File

@@ -27,6 +27,8 @@ export default function initialize() {
//Everyone has a home
addNavItem(locale.get("Home"), "home", "/");
//NOTE: If a user has read full record or better then they should have access to that area
if (
roles.hasRole(roles.AUTHORIZATION_ROLES.TechLimited) ||
roles.hasRole(roles.AUTHORIZATION_ROLES.TechFull) ||
@@ -45,7 +47,9 @@ export default function initialize() {
if (
roles.hasRole(roles.AUTHORIZATION_ROLES.InventoryLimited) ||
roles.hasRole(roles.AUTHORIZATION_ROLES.InventoryFull)
roles.hasRole(roles.AUTHORIZATION_ROLES.InventoryFull) ||
roles.hasRole(roles.AUTHORIZATION_ROLES.BizAdminLimited) ||
roles.hasRole(roles.AUTHORIZATION_ROLES.BizAdminFull)
) {
addNavItem(locale.get("Inventory"), "dolly", "/inventory");
}