This commit is contained in:
@@ -2,72 +2,97 @@ import authorizationroles from "./authorizationroles";
|
||||
let role = authorizationroles.AUTHORIZATION_ROLES;
|
||||
export default {
|
||||
registry: {
|
||||
TestWidgetsPriciest: {
|
||||
roles: [
|
||||
role.BizAdminFull,
|
||||
role.BizAdminLimited,
|
||||
role.SalesFull,
|
||||
role.SalesLimited
|
||||
],
|
||||
title: "Priciest widgets",
|
||||
type: "GzDashTestWidgetsPriciest"
|
||||
},
|
||||
dashBizOnlyTest: {
|
||||
roles: [role.BizAdminFull, role.BizAdminLimited],
|
||||
title: "Biz only test item"
|
||||
title: "Biz only test item",
|
||||
type: "GzDashBase"
|
||||
},
|
||||
dashTechOnlyTest: {
|
||||
roles: [role.TechFull, role.TechLimited],
|
||||
title: "Tech only test item"
|
||||
title: "Tech only test item",
|
||||
type: "GzDashBase"
|
||||
},
|
||||
dashSalesOnlyTest: {
|
||||
roles: [role.SalesFull, role.SalesLimited],
|
||||
title: "Sales only test item"
|
||||
title: "Sales only test item",
|
||||
type: "GzDashBase"
|
||||
},
|
||||
dashBizOnlyTest1: {
|
||||
roles: [role.BizAdminFull, role.BizAdminLimited],
|
||||
title: "1Biz only test item"
|
||||
title: "1Biz only test item",
|
||||
type: "GzDashBase"
|
||||
},
|
||||
dashTechOnlyTest1: {
|
||||
roles: [role.TechFull, role.TechLimited],
|
||||
title: "1Tech only test item"
|
||||
title: "1Tech only test item",
|
||||
type: "GzDashBase"
|
||||
},
|
||||
dashSalesOnlyTest1: {
|
||||
roles: [role.SalesFull, role.SalesLimited],
|
||||
title: "1Sales only test item"
|
||||
title: "1Sales only test item",
|
||||
type: "GzDashBase"
|
||||
},
|
||||
dashBizOnlyTest2: {
|
||||
roles: [role.BizAdminFull, role.BizAdminLimited],
|
||||
title: "2Biz only test item"
|
||||
title: "2Biz only test item",
|
||||
type: "GzDashBase"
|
||||
},
|
||||
dashTechOnlyTest2: {
|
||||
roles: [role.TechFull, role.TechLimited],
|
||||
title: "2Tech only test item"
|
||||
title: "2Tech only test item",
|
||||
type: "GzDashBase"
|
||||
},
|
||||
dashSalesOnlyTest2: {
|
||||
roles: [role.SalesFull, role.SalesLimited],
|
||||
title: "2Sales only test item"
|
||||
title: "2Sales only test item",
|
||||
type: "GzDashBase"
|
||||
},
|
||||
dashBizOnlyTest3: {
|
||||
roles: [role.BizAdminFull, role.BizAdminLimited],
|
||||
title: "3Biz only test item"
|
||||
title: "3Biz only test item",
|
||||
type: "GzDashBase"
|
||||
},
|
||||
dashTechOnlyTest3: {
|
||||
roles: [role.TechFull, role.TechLimited],
|
||||
title: "3Tech only test item"
|
||||
title: "3Tech only test item",
|
||||
type: "GzDashBase"
|
||||
},
|
||||
dashSalesOnlyTest3: {
|
||||
roles: [role.SalesFull, role.SalesLimited],
|
||||
title: "3Sales only test item"
|
||||
title: "3Sales only test item",
|
||||
type: "GzDashBase"
|
||||
},
|
||||
dashBizOnlyTest4: {
|
||||
roles: [role.BizAdminFull, role.BizAdminLimited],
|
||||
title: "4Biz only test item"
|
||||
title: "4Biz only test item",
|
||||
type: "GzDashBase"
|
||||
},
|
||||
dashTechOnlyTest4: {
|
||||
roles: [role.TechFull, role.TechLimited],
|
||||
title: "4Tech only test item"
|
||||
title: "4Tech only test item",
|
||||
type: "GzDashBase"
|
||||
},
|
||||
dashSalesOnlyTest: {
|
||||
roles: [role.SalesFull, role.SalesLimited],
|
||||
title: "4Sales only test item"
|
||||
title: "4Sales only test item",
|
||||
type: "GzDashBase"
|
||||
}
|
||||
},
|
||||
availableItems() {
|
||||
let ret = [];
|
||||
for (const [key, value] of Object.entries(this.registry)) {
|
||||
if (authorizationroles.hasRole(value.roles)) {
|
||||
ret.push({ id: key, title: value.title });
|
||||
ret.push({ id: key, title: value.title, type: value.type });
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
|
||||
Reference in New Issue
Block a user