This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
import authorizationroles from "./authorizationroles";
|
||||
let role = authorizationroles.AUTHORIZATION_ROLES;
|
||||
export default {
|
||||
registry: {
|
||||
TestWidgetsPriciest: {
|
||||
registry: [
|
||||
{
|
||||
id: "TestWidgetsPriciest",
|
||||
roles: [
|
||||
role.BizAdminFull,
|
||||
role.BizAdminLimited,
|
||||
@@ -12,89 +13,38 @@ export default {
|
||||
title: "Priciest widgets",
|
||||
type: "GzDashTestWidgetsPriciest"
|
||||
},
|
||||
dashBizOnlyTest: {
|
||||
{
|
||||
id: "dashBizOnlyTest",
|
||||
roles: [role.BizAdminFull, role.BizAdminLimited],
|
||||
title: "Biz only test item",
|
||||
type: "GzDashBase"
|
||||
},
|
||||
dashTechOnlyTest: {
|
||||
{
|
||||
id: "dashTechOnlyTest",
|
||||
roles: [role.TechFull, role.TechLimited],
|
||||
title: "Tech only test item",
|
||||
type: "GzDashBase"
|
||||
},
|
||||
dashSalesOnlyTest: {
|
||||
{
|
||||
id: "dashSalesOnlyTest",
|
||||
roles: [role.SalesFull, role.SalesLimited],
|
||||
title: "Sales only test item",
|
||||
type: "GzDashBase"
|
||||
},
|
||||
dashBizOnlyTest1: {
|
||||
roles: [role.BizAdminFull, role.BizAdminLimited],
|
||||
title: "1Biz only test item",
|
||||
type: "GzDashBase"
|
||||
},
|
||||
dashTechOnlyTest1: {
|
||||
roles: [role.TechFull, role.TechLimited],
|
||||
title: "1Tech only test item",
|
||||
type: "GzDashBase"
|
||||
},
|
||||
dashSalesOnlyTest1: {
|
||||
roles: [role.SalesFull, role.SalesLimited],
|
||||
title: "1Sales only test item",
|
||||
type: "GzDashBase"
|
||||
},
|
||||
dashBizOnlyTest2: {
|
||||
roles: [role.BizAdminFull, role.BizAdminLimited],
|
||||
title: "2Biz only test item",
|
||||
type: "GzDashBase"
|
||||
},
|
||||
dashTechOnlyTest2: {
|
||||
roles: [role.TechFull, role.TechLimited],
|
||||
title: "2Tech only test item",
|
||||
type: "GzDashBase"
|
||||
},
|
||||
dashSalesOnlyTest2: {
|
||||
roles: [role.SalesFull, role.SalesLimited],
|
||||
title: "2Sales only test item",
|
||||
type: "GzDashBase"
|
||||
},
|
||||
dashBizOnlyTest3: {
|
||||
roles: [role.BizAdminFull, role.BizAdminLimited],
|
||||
title: "3Biz only test item",
|
||||
type: "GzDashBase"
|
||||
},
|
||||
dashTechOnlyTest3: {
|
||||
roles: [role.TechFull, role.TechLimited],
|
||||
title: "3Tech only test item",
|
||||
type: "GzDashBase"
|
||||
},
|
||||
dashSalesOnlyTest3: {
|
||||
roles: [role.SalesFull, role.SalesLimited],
|
||||
title: "3Sales only test item",
|
||||
type: "GzDashBase"
|
||||
},
|
||||
dashBizOnlyTest4: {
|
||||
roles: [role.BizAdminFull, role.BizAdminLimited],
|
||||
title: "4Biz only test item",
|
||||
type: "GzDashBase"
|
||||
},
|
||||
dashTechOnlyTest4: {
|
||||
roles: [role.TechFull, role.TechLimited],
|
||||
title: "4Tech only test item",
|
||||
type: "GzDashBase"
|
||||
},
|
||||
dashSalesOnlyTest: {
|
||||
roles: [role.SalesFull, role.SalesLimited],
|
||||
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, type: value.type });
|
||||
for (let i = 0; i < this.registry.length; i++) {
|
||||
let item = this.registry[i];
|
||||
if (authorizationroles.hasRole(item.roles)) {
|
||||
ret.push({ id: item.id, title: item.title, type: item.type });
|
||||
}
|
||||
}
|
||||
// for (const [key, value] of Object.entries(this.registry)) {
|
||||
// if (authorizationroles.hasRole(value.roles)) {
|
||||
// ret.push({ id: key, title: value.title, type: value.type });
|
||||
// }
|
||||
// }
|
||||
return ret;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
moreUrl="/home-dashboard"
|
||||
icon="$ayiSplotch"
|
||||
:updateFrequency="60000"
|
||||
v-on="$listeners"
|
||||
v-bind="$attrs"
|
||||
>
|
||||
MY CONTENT HERE
|
||||
</gz-dash>
|
||||
@@ -18,7 +20,12 @@ export default {
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
props: {},
|
||||
props: {
|
||||
// id: {
|
||||
// type: String,
|
||||
// required: true
|
||||
// }
|
||||
},
|
||||
created() {},
|
||||
|
||||
computed: {},
|
||||
|
||||
Reference in New Issue
Block a user