diff --git a/ayanova/devdocs/test protocol.txt b/ayanova/devdocs/test protocol.txt index 3b8a2d51..ab8ce9c1 100644 --- a/ayanova/devdocs/test protocol.txt +++ b/ayanova/devdocs/test protocol.txt @@ -70,9 +70,9 @@ EDGE desktop - Rights work properly - Test as manager - Test widget form under full, edit own and readonly and no rights, confirm it works - - Roles: Change = AuthorizationRoles.BizAdminFull | AuthorizationRoles.InventoryFull, EditOwn = AuthorizationRoles.TechFull, ReadFullRecord = AuthorizationRoles.BizAdminLimited | AuthorizationRoles.InventoryLimited + - Roles: Change = AuthorizationRoles.BizAdmin | AuthorizationRoles.Inventory, EditOwn = AuthorizationRoles.Tech, ReadRecord = AuthorizationRoles.BizAdminRestricted | AuthorizationRoles.InventoryRestricted - 401 redirect to login - - 403 should redirect to prior form (no rights SubContractorLimited) + - 403 should redirect to prior form (no rights SubContractorRestricted) diff --git a/ayanova/src/api/authorizationroles.js b/ayanova/src/api/authorizationroles.js index 37894e63..9904e716 100644 --- a/ayanova/src/api/authorizationroles.js +++ b/ayanova/src/api/authorizationroles.js @@ -7,40 +7,40 @@ export default { AUTHORIZATION_ROLES: { ///No role set NoRole: 0, - ///BizAdminLimited - BizAdminLimited: 1, - ///BizAdminFull - BizAdminFull: 2, - ///ServiceLimited - ServiceLimited: 4, - ///ServiceFull - ServiceFull: 8, - ///InventoryLimited - InventoryLimited: 16, - ///InventoryFull - InventoryFull: 32, - ///AccountingFull - AccountingFull: 64, //No limited role, not sure if there is a need - ///TechLimited - TechLimited: 128, - ///TechFull - TechFull: 256, - ///SubContractorLimited - SubContractorLimited: 512, - ///SubContractorFull - SubContractorFull: 1024, - ///CustomerLimited - CustomerLimited: 2048, - ///CustomerFull - CustomerFull: 4096, - ///OpsAdminLimited - OpsAdminLimited: 8192, - ///OpsAdminFull - OpsAdminFull: 16384, - ///SalesFull - SalesFull: 32768, - ///SalesLimited - SalesLimited: 65536 + ///BizAdminRestricted + BizAdminRestricted: 1, + ///BizAdmin + BizAdmin: 2, + ///ServiceRestricted + ServiceRestricted: 4, + ///Service + Service: 8, + ///InventoryRestricted + InventoryRestricted: 16, + ///Inventory + Inventory: 32, + ///Accounting + Accounting: 64, //No restricted role, not sure if there is a need + ///TechRestricted + TechRestricted: 128, + ///Tech + Tech: 256, + ///SubContractorRestricted + SubContractorRestricted: 512, + ///SubContractor + SubContractor: 1024, + ///CustomerRestricted + CustomerRestricted: 2048, + ///Customer + Customer: 4096, + ///OpsAdminRestricted + OpsAdminRestricted: 8192, + ///OpsAdmin + OpsAdmin: 16384, + ///Sales + Sales: 32768, + ///SalesRestricted + SalesRestricted: 65536 }, ////////////////////////////////////////////////////////// // Does current logged in user have role? diff --git a/ayanova/src/api/dash-registry.js b/ayanova/src/api/dash-registry.js index 3af959c0..ec20c981 100644 --- a/ayanova/src/api/dash-registry.js +++ b/ayanova/src/api/dash-registry.js @@ -5,10 +5,10 @@ export default { { id: "TestListWidgetsPriciest", roles: [ - role.BizAdminFull, - role.BizAdminLimited, - role.SalesFull, - role.SalesLimited + role.BizAdmin, + role.BizAdminRestricted, + role.Sales, + role.SalesRestricted ], title: "Priciest widgets (all time) ", type: "GzDashTestListWidgetsPriciest" @@ -16,10 +16,10 @@ export default { { id: "TestBarWidgetCountByUserType", roles: [ - role.BizAdminFull, - role.BizAdminLimited, - role.SalesFull, - role.SalesLimited + role.BizAdmin, + role.BizAdminRestricted, + role.Sales, + role.SalesRestricted ], title: "Widgets by User type", type: "GzDashTestBarWidgetCountByUserType" @@ -27,10 +27,10 @@ export default { { id: "TestLineWidgetMonthlyTotalPrice", roles: [ - role.BizAdminFull, - role.BizAdminLimited, - role.SalesFull, - role.SalesLimited + role.BizAdmin, + role.BizAdminRestricted, + role.Sales, + role.SalesRestricted ], title: "Widget monthly total", type: "GzDashTestLineWidgetMonthlyTotalPrice" @@ -38,10 +38,10 @@ export default { { id: "TestDayCalendarWidget", roles: [ - role.BizAdminFull, - role.BizAdminLimited, - role.SalesFull, - role.SalesLimited + role.BizAdmin, + role.BizAdminRestricted, + role.Sales, + role.SalesRestricted ], title: "WO calendar", type: "GzDashTestDayCalendarWidget" diff --git a/ayanova/src/api/gzmenu.js b/ayanova/src/api/gzmenu.js index 66c19f46..2d6bdff1 100644 --- a/ayanova/src/api/gzmenu.js +++ b/ayanova/src/api/gzmenu.js @@ -168,11 +168,11 @@ export default { ctx.formData && ctx.formData.formCustomTemplateKey != undefined && window.$gz.role.hasRole([ - window.$gz.role.AUTHORIZATION_ROLES.BizAdminFull, - window.$gz.role.AUTHORIZATION_ROLES.BizAdminLimited + window.$gz.role.AUTHORIZATION_ROLES.BizAdminRestricted, + window.$gz.role.AUTHORIZATION_ROLES.BizAdminRestricted ]) ) { - //NOTE: BizAdminFull can edit, bizadminlimited can read only + //NOTE: BizAdmin can edit, BizAdminRestricted can read only //add customize menu item //DIVIDER //Insert the devider between context and global items diff --git a/ayanova/src/components/role-control.vue b/ayanova/src/components/role-control.vue index cb1ed1d5..4262b6df 100644 --- a/ayanova/src/components/role-control.vue +++ b/ayanova/src/components/role-control.vue @@ -26,7 +26,7 @@ export default { this.availableRoles = rawRoles; } else { if (this.limitSelectionTo == "inside") { - //CustomerLimited=2048, CustomerFull=4096 + //CustomerRestricted=2048, Customer=4096 this.availableRoles = rawRoles.filter( z => z.id != 2048 && z.id != 4096 ); diff --git a/ayanova/src/store.js b/ayanova/src/store.js index 923b8a7a..04e0a72e 100644 --- a/ayanova/src/store.js +++ b/ayanova/src/store.js @@ -37,7 +37,7 @@ export default new Vuex.Store({ userType: 0, homePage: undefined, translationText: {}, - enums: {}, //all enum values with translated text to match stored as key e.g. enums:={AuthorizationRoles:{0:"no role",1:"Limited role"},UserTypes:{0:"Technician",1:"Client user"}} + enums: {}, //all enum values with translated text to match stored as key userOptions: { languageOverride: "en-US", timeZoneOverride: null, //use browser tz by default @@ -147,7 +147,7 @@ export default new Vuex.Store({ state.globalSettings = data; }, setEnum(state, data) { - state.enums[data.enumKey] = data.items; //{enumKey:"AuthorizationRoles",items:[{0:"no role"},{1:"Limited role"}]} + state.enums[data.enumKey] = data.items; //{enumKey:"AuthorizationRoles",items:[{0:"no role"},{1:"Restricted role"}]} }, setAPIURL(state, data) { state.apiUrl = data; diff --git a/ayanova/src/views/adm-import.vue b/ayanova/src/views/adm-import.vue index 53a0883f..7f5dba7e 100644 --- a/ayanova/src/views/adm-import.vue +++ b/ayanova/src/views/adm-import.vue @@ -48,7 +48,7 @@ const FORM_KEY = "adm-import"; export default { async created() { - //NOTE: chose this because there is no general import but report covers bizadminfull and bizadminlimited + //NOTE: chose this because there is no general import but report covers bizadmin and bizadminrestricted this.rights = window.$gz.role.getRights(window.$gz.type.Report); window.$gz.eventBus.$on("menu-click", clickHandler); await fetchTranslatedText(this); diff --git a/ayanova/src/views/home-review.vue b/ayanova/src/views/home-review.vue index 5873f6a4..0c528a6a 100644 --- a/ayanova/src/views/home-review.vue +++ b/ayanova/src/views/home-review.vue @@ -298,11 +298,11 @@ export default { rights: window.$gz.role.defaultRightsObject(), ayaType: window.$gz.type.Review, currentUserIsASupervisor: window.$gz.role.hasRole([ - window.$gz.role.AUTHORIZATION_ROLES.BizAdminFull, - window.$gz.role.AUTHORIZATION_ROLES.ServiceFull, - window.$gz.role.AUTHORIZATION_ROLES.InventoryFull, - window.$gz.role.AUTHORIZATION_ROLES.SalesFull, - window.$gz.role.AUTHORIZATION_ROLES.AccountingFull + window.$gz.role.AUTHORIZATION_ROLES.BizAdmin, + window.$gz.role.AUTHORIZATION_ROLES.Service, + window.$gz.role.AUTHORIZATION_ROLES.Inventory, + window.$gz.role.AUTHORIZATION_ROLES.Sales, + window.$gz.role.AUTHORIZATION_ROLES.Accounting ]), name: null }; @@ -352,18 +352,18 @@ export default { hasSupervisorRole: function() { //mirrored from ReviewBiz.cs validation rule at server /* - CurrentUserRoles.HasFlag(AuthorizationRoles.BizAdminFull) || - CurrentUserRoles.HasFlag(AuthorizationRoles.ServiceFull) || - CurrentUserRoles.HasFlag(AuthorizationRoles.InventoryFull) || - CurrentUserRoles.HasFlag(AuthorizationRoles.SalesFull) || - CurrentUserRoles.HasFlag(AuthorizationRoles.AccountingFull); + CurrentUserRoles.HasFlag(AuthorizationRoles.BizAdmin) || + CurrentUserRoles.HasFlag(AuthorizationRoles.Service) || + CurrentUserRoles.HasFlag(AuthorizationRoles.Inventory) || + CurrentUserRoles.HasFlag(AuthorizationRoles.Sales) || + CurrentUserRoles.HasFlag(AuthorizationRoles.Accounting); */ return window.$gz.role.hasRole([ - window.$gz.role.AUTHORIZATION_ROLES.BizAdminFull, - window.$gz.role.AUTHORIZATION_ROLES.ServiceFull, - window.$gz.role.AUTHORIZATION_ROLES.InventoryFull, - window.$gz.role.AUTHORIZATION_ROLES.SalesFull, - window.$gz.role.AUTHORIZATION_ROLES.AccountingFull + window.$gz.role.AUTHORIZATION_ROLES.BizAdmin, + window.$gz.role.AUTHORIZATION_ROLES.Service, + window.$gz.role.AUTHORIZATION_ROLES.Inventory, + window.$gz.role.AUTHORIZATION_ROLES.Sales, + window.$gz.role.AUTHORIZATION_ROLES.Accounting ]); } }, diff --git a/ayanova/src/views/inv-purchase-order.vue b/ayanova/src/views/inv-purchase-order.vue index b10aa741..84e4dcb1 100644 --- a/ayanova/src/views/inv-purchase-order.vue +++ b/ayanova/src/views/inv-purchase-order.vue @@ -998,7 +998,7 @@ export default { }, rights: window.$gz.role.defaultRightsObject(), canEditSerial: window.$gz.role.hasRole([ - window.$gz.role.AUTHORIZATION_ROLES.BizAdminFull + window.$gz.role.AUTHORIZATION_ROLES.BizAdmin ]), ayaType: window.$gz.type.PurchaseOrder, currencyName: window.$gz.locale.getCurrencyName(), diff --git a/ayanova/src/views/login.vue b/ayanova/src/views/login.vue index 28816ebf..31fc2397 100644 --- a/ayanova/src/views/login.vue +++ b/ayanova/src/views/login.vue @@ -267,33 +267,33 @@ export default { }, { name: "Business admin", - l: "BizAdminFull", - p: "BizAdminFull" + l: "BizAdmin", + p: "BizAdmin" }, { - name: "Business admin - limited", - l: "BizAdminLimited", - p: "BizAdminLimited" + name: "Business admin - restricted", + l: "BizAdminRestricted", + p: "BizAdminRestricted" }, { name: "Customer", - l: "CustomerFull", - p: "CustomerFull" + l: "Customer", + p: "Customer" }, { - name: "Customer - limited", - l: "CustomerLimited", - p: "CustomerLimited" + name: "Customer - restricted", + l: "CustomerRestricted", + p: "CustomerRestricted" }, { name: "Service", - l: "ServiceFull", - p: "ServiceFull" + l: "Service", + p: "Service" }, { - name: "Service - limited", - l: "ServiceLimited", - p: "ServiceLimited" + name: "Service - restricted", + l: "ServiceRestricted", + p: "ServiceRestricted" }, { name: "Head office", @@ -302,53 +302,53 @@ export default { }, { name: "Inventory", - l: "InventoryFull", - p: "InventoryFull" + l: "Inventory", + p: "Inventory" }, { - name: "Inventory - limited", - l: "InventoryLimited", - p: "InventoryLimited" + name: "Inventory - restricted", + l: "InventoryRestricted", + p: "InventoryRestricted" }, { name: "Operations", - l: "OpsAdminFull", - p: "OpsAdminFull" + l: "OpsAdmin", + p: "OpsAdmin" }, { - name: "Operations - limited", - l: "OpsAdminLimited", - p: "OpsAdminLimited" + name: "Operations - restricted", + l: "OpsAdminRestricted", + p: "OpsAdminRestricted" }, { name: "Sales", - l: "SalesFull", - p: "SalesFull" + l: "Sales", + p: "Sales" }, { - name: "Sales - limited", - l: "SalesLimited", - p: "SalesLimited" + name: "Sales - restricted", + l: "SalesRestricted", + p: "SalesRestricted" }, { name: "Subcontractor", - l: "SubContractorFull", - p: "SubContractorFull" + l: "SubContractor", + p: "SubContractor" }, { - name: "Subcontractor - limited", - l: "SubContractorLimited", - p: "SubContractorLimited" + name: "Subcontractor - restricted", + l: "SubContractorRestricted", + p: "SubContractorRestricted" }, { name: "Technician", - l: "TechFull", - p: "TechFull" + l: "Tech", + p: "Tech" }, { - name: "Technician - limited", - l: "TechLimited", - p: "TechLimited" + name: "Technician - restricted", + l: "TechRestricted", + p: "TechRestricted" }, { name: "Translation - Deutsch / German", diff --git a/ayanova/tests/e2e/OLD/gz-data-table.js b/ayanova/tests/e2e/OLD/gz-data-table.js index 2ca42dfb..2a3afa84 100644 --- a/ayanova/tests/e2e/OLD/gz-data-table.js +++ b/ayanova/tests/e2e/OLD/gz-data-table.js @@ -4,12 +4,12 @@ describe("GZ-DATA-TABLE", () => { cy.get("input[name=username]") .clear() - .type("BizAdminFull"); + .type("BizAdmin"); // {enter} causes the form to submit cy.get("input[name=password]") .clear() - .type("BizAdminFull{enter}"); + .type("BizAdmin{enter}"); //cy.url().should("include", "/home-dashboard"); cy.visit("/widgets"); cy.url().should("include", "/widgets"); diff --git a/ayanova/tests/e2e/specs/smoke.js b/ayanova/tests/e2e/specs/smoke.js index 08a687f0..2395c9bb 100644 --- a/ayanova/tests/e2e/specs/smoke.js +++ b/ayanova/tests/e2e/specs/smoke.js @@ -453,10 +453,10 @@ describe("SMOKE", () => { //CUSTOMER PAGES cy.get("input[name=username]") .clear() - .type("CustomerFull"); + .type("Customer"); cy.get("input[name=password]") .clear() - .type("CustomerFull{enter}"); + .type("Customer{enter}"); cy.url({ timeout: 10000 }).should("include", "/customer-csr"); cy.get("[data-cy=underconstruction]"); diff --git a/ayanova/tests/e2e/specs/translation-about.js b/ayanova/tests/e2e/specs/translation-about.js index c31dc588..8d40eab8 100644 --- a/ayanova/tests/e2e/specs/translation-about.js +++ b/ayanova/tests/e2e/specs/translation-about.js @@ -95,15 +95,15 @@ describe("TRANSLATION", () => { cy.url().should("include", "/login"); //----------------------------------------------------- - //ENGLISH - CustomerLimited + //ENGLISH - CustomerRestricted cy.get("input[name=username]") .clear() - .type("CustomerLimited"); + .type("CustomerRestricted"); // {enter} causes the form to submit cy.get("input[name=password]") .clear() - .type("CustomerLimited{enter}"); + .type("CustomerRestricted{enter}"); // we should be redirected to /customer-csr cy.url().should("include", "/customer-csr");