From 4c957e36f3b5055be7e9a6338ece726c59f3777d Mon Sep 17 00:00:00 2001 From: Cody Mitchell Date: Wed, 27 Nov 2024 09:43:16 -0500 Subject: [PATCH] fix: require perms to use intergrations widget (#740) --- rest/models/DashboardTemplate.go | 7 ++++--- rest/service/dashboardTemplate.go | 6 ++++++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/rest/models/DashboardTemplate.go b/rest/models/DashboardTemplate.go index 82c0ac15..fc02509f 100644 --- a/rest/models/DashboardTemplate.go +++ b/rest/models/DashboardTemplate.go @@ -331,9 +331,10 @@ type WidgetHeaderLink struct { type WidgetPermissionMethods string const ( - OrgAdmin WidgetPermissionMethods = "isOrgAdmin" - FeatureFlag WidgetPermissionMethods = "featureFlag" - HasPermissions WidgetPermissionMethods = "hasPermissions" + OrgAdmin WidgetPermissionMethods = "isOrgAdmin" + FeatureFlag WidgetPermissionMethods = "featureFlag" + HasPermissions WidgetPermissionMethods = "hasPermissions" + LoosePermissions WidgetPermissionMethods = "loosePermissions" ) type WidgetPermission struct { diff --git a/rest/service/dashboardTemplate.go b/rest/service/dashboardTemplate.go index 51e5b738..ea6aebcf 100644 --- a/rest/service/dashboardTemplate.go +++ b/rest/service/dashboardTemplate.go @@ -219,6 +219,12 @@ var ( true, }, }, + models.WidgetPermission{ + Method: models.LoosePermissions, + Args: []any{ + []string{"sources:*:read", "integrations:endpoints:read"}, + }, + }, }, }, },