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