From a6dabfe3eab09393e04712d613f8db3022885dff Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Wed, 5 Jun 2019 21:02:51 +0000 Subject: [PATCH] --- ayanova/src/api/authorizationroles.js | 19 ++++--- ayanova/src/api/gzform.js | 1 - ayanova/src/api/initialize.js | 6 ++- .../src/components/inventorywidgetlist.vue | 51 ++++++++++++++----- ayanova/src/views/inventory-widget-edit.vue | 17 ++++++- 5 files changed, 71 insertions(+), 23 deletions(-) diff --git a/ayanova/src/api/authorizationroles.js b/ayanova/src/api/authorizationroles.js index 21e1c13b..c63c1a8f 100644 --- a/ayanova/src/api/authorizationroles.js +++ b/ayanova/src/api/authorizationroles.js @@ -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) { diff --git a/ayanova/src/api/gzform.js b/ayanova/src/api/gzform.js index 05cf38c0..382b4c93 100644 --- a/ayanova/src/api/gzform.js +++ b/ayanova/src/api/gzform.js @@ -13,7 +13,6 @@ import Vue from "vue"; import errorHandler from "./errorhandler"; import store from "../store"; - var triggeringChange = false; function isEmpty(o) { diff --git a/ayanova/src/api/initialize.js b/ayanova/src/api/initialize.js index 9394b1ae..3892564a 100644 --- a/ayanova/src/api/initialize.js +++ b/ayanova/src/api/initialize.js @@ -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"); } diff --git a/ayanova/src/components/inventorywidgetlist.vue b/ayanova/src/components/inventorywidgetlist.vue index f689d171..daf20e8a 100644 --- a/ayanova/src/components/inventorywidgetlist.vue +++ b/ayanova/src/components/inventorywidgetlist.vue @@ -23,10 +23,10 @@ }} - + fa-plus-circle - + fa-filter @@ -47,21 +47,36 @@ :rows-per-page-items="rowsPerPageItems" :rows-per-page-text="this.$gzlocale.get('RowsPerPage')" class="elevation-1" + select-all > @@ -71,12 +86,13 @@