61 lines
1.5 KiB
JavaScript
61 lines
1.5 KiB
JavaScript
import authorizationroles from "./authorizationroles";
|
|
let role = authorizationroles.AUTHORIZATION_ROLES;
|
|
export default {
|
|
registry: [
|
|
{
|
|
id: "TestListWidgetsPriciest",
|
|
roles: [
|
|
role.BizAdminFull,
|
|
role.BizAdminLimited,
|
|
role.SalesFull,
|
|
role.SalesLimited
|
|
],
|
|
title: "Priciest widgets (all time) ",
|
|
type: "GzDashTestListWidgetsPriciest"
|
|
},
|
|
{
|
|
id: "TestBarWidgetCountByUserType",
|
|
roles: [
|
|
role.BizAdminFull,
|
|
role.BizAdminLimited,
|
|
role.SalesFull,
|
|
role.SalesLimited
|
|
],
|
|
title: "Widgets by User type",
|
|
type: "GzDashTestBarWidgetCountByUserType"
|
|
},
|
|
{
|
|
id: "TestLineWidgetMonthlyTotalPrice",
|
|
roles: [
|
|
role.BizAdminFull,
|
|
role.BizAdminLimited,
|
|
role.SalesFull,
|
|
role.SalesLimited
|
|
],
|
|
title: "Widget monthly total",
|
|
type: "GzDashTestLineWidgetMonthlyTotalPrice"
|
|
},
|
|
{
|
|
id: "TestDayCalendarWidget",
|
|
roles: [
|
|
role.BizAdminFull,
|
|
role.BizAdminLimited,
|
|
role.SalesFull,
|
|
role.SalesLimited
|
|
],
|
|
title: "WO calendar",
|
|
type: "GzDashTestDayCalendarWidget"
|
|
}
|
|
],
|
|
availableItems() {
|
|
let ret = [];
|
|
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 });
|
|
}
|
|
}
|
|
return ret;
|
|
}
|
|
};
|