Renamed roles and trans keys "Limited"->"Restricted" "Full" -> ""
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -7,40 +7,40 @@ export default {
|
||||
AUTHORIZATION_ROLES: {
|
||||
///<summary>No role set</summary>
|
||||
NoRole: 0,
|
||||
///<summary>BizAdminLimited</summary>
|
||||
BizAdminLimited: 1,
|
||||
///<summary>BizAdminFull</summary>
|
||||
BizAdminFull: 2,
|
||||
///<summary>ServiceLimited</summary>
|
||||
ServiceLimited: 4,
|
||||
///<summary>ServiceFull</summary>
|
||||
ServiceFull: 8,
|
||||
///<summary>InventoryLimited</summary>
|
||||
InventoryLimited: 16,
|
||||
///<summary>InventoryFull</summary>
|
||||
InventoryFull: 32,
|
||||
///<summary>AccountingFull</summary>
|
||||
AccountingFull: 64, //No limited role, not sure if there is a need
|
||||
///<summary>TechLimited</summary>
|
||||
TechLimited: 128,
|
||||
///<summary>TechFull</summary>
|
||||
TechFull: 256,
|
||||
///<summary>SubContractorLimited</summary>
|
||||
SubContractorLimited: 512,
|
||||
///<summary>SubContractorFull</summary>
|
||||
SubContractorFull: 1024,
|
||||
///<summary>CustomerLimited</summary>
|
||||
CustomerLimited: 2048,
|
||||
///<summary>CustomerFull</summary>
|
||||
CustomerFull: 4096,
|
||||
///<summary>OpsAdminLimited</summary>
|
||||
OpsAdminLimited: 8192,
|
||||
///<summary>OpsAdminFull</summary>
|
||||
OpsAdminFull: 16384,
|
||||
///<summary>SalesFull</summary>
|
||||
SalesFull: 32768,
|
||||
///<summary>SalesLimited</summary>
|
||||
SalesLimited: 65536
|
||||
///<summary>BizAdminRestricted</summary>
|
||||
BizAdminRestricted: 1,
|
||||
///<summary>BizAdmin</summary>
|
||||
BizAdmin: 2,
|
||||
///<summary>ServiceRestricted</summary>
|
||||
ServiceRestricted: 4,
|
||||
///<summary>Service</summary>
|
||||
Service: 8,
|
||||
///<summary>InventoryRestricted</summary>
|
||||
InventoryRestricted: 16,
|
||||
///<summary>Inventory</summary>
|
||||
Inventory: 32,
|
||||
///<summary>Accounting</summary>
|
||||
Accounting: 64, //No restricted role, not sure if there is a need
|
||||
///<summary>TechRestricted</summary>
|
||||
TechRestricted: 128,
|
||||
///<summary>Tech</summary>
|
||||
Tech: 256,
|
||||
///<summary>SubContractorRestricted</summary>
|
||||
SubContractorRestricted: 512,
|
||||
///<summary>SubContractor</summary>
|
||||
SubContractor: 1024,
|
||||
///<summary>CustomerRestricted</summary>
|
||||
CustomerRestricted: 2048,
|
||||
///<summary>Customer</summary>
|
||||
Customer: 4096,
|
||||
///<summary>OpsAdminRestricted</summary>
|
||||
OpsAdminRestricted: 8192,
|
||||
///<summary>OpsAdmin</summary>
|
||||
OpsAdmin: 16384,
|
||||
///<summary>Sales</summary>
|
||||
Sales: 32768,
|
||||
///<summary>SalesRestricted</summary>
|
||||
SalesRestricted: 65536
|
||||
},
|
||||
//////////////////////////////////////////////////////////
|
||||
// Does current logged in user have role?
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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
|
||||
]);
|
||||
}
|
||||
},
|
||||
|
||||
@@ -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(),
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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]");
|
||||
|
||||
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user