Skip to content

Commit

Permalink
fix: configure general read/write permissions for ds plugin.json config
Browse files Browse the repository at this point in the history
  • Loading branch information
VikaCep committed Nov 12, 2024
1 parent 184b4f0 commit eb905b0
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/datasource/plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"path": "viewer-token",
"method": "*",
"url": "{{.JsonData.apiHost}}/api/v1/register/viewer-token",
"reqRole": "Editor",
"reqAction": "grafana-synthetic-monitoring-app:write",
"headers": [
{
"name": "Authorization",
Expand All @@ -21,7 +21,7 @@
"path": "save",
"method": "*",
"url": "{{.JsonData.apiHost}}/api/v1/register/save",
"reqRole": "Editor",
"reqAction": "grafana-synthetic-monitoring-app:write",
"headers": [
{
"name": "Authorization",
Expand All @@ -33,7 +33,7 @@
"path": "sm",
"method": "GET",
"url": "{{.JsonData.apiHost}}/api/v1/",
"reqRole": "Viewer",
"reqAction": "grafana-synthetic-monitoring-app:read",
"headers": [
{
"name": "Authorization",
Expand All @@ -45,7 +45,7 @@
"path": "sm",
"method": "POST",
"url": "{{.JsonData.apiHost}}/api/v1/",
"reqRole": "Editor",
"reqAction": "grafana-synthetic-monitoring-app:write",
"headers": [
{
"name": "Authorization",
Expand All @@ -57,7 +57,7 @@
"path": "sm",
"method": "DELETE",
"url": "{{.JsonData.apiHost}}/api/v1/",
"reqRole": "Editor",
"reqAction": "grafana-synthetic-monitoring-app:write",
"headers": [
{
"name": "Authorization",
Expand Down
20 changes: 20 additions & 0 deletions src/plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
"description": "Read checks in the Synthetic Monitoring app",
"permissions": [
{ "action": "plugins.app:access", "scope": "plugins:id:grafana-synthetic-monitoring-app" },
{ "action": "grafana-synthetic-monitoring-app:read" },

{ "action": "grafana-synthetic-monitoring-app.checks:read" }
]
Expand All @@ -96,6 +97,8 @@
"description": "Create, edit and delete checks in the Synthetic Monitoring app",
"permissions": [
{ "action": "plugins.app:access", "scope": "plugins:id:grafana-synthetic-monitoring-app" },
{ "action": "grafana-synthetic-monitoring-app:read" },
{ "action": "grafana-synthetic-monitoring-app:write" },

{ "action": "grafana-synthetic-monitoring-app.checks:edit" },
{ "action": "grafana-synthetic-monitoring-app.checks:read" },
Expand All @@ -110,6 +113,7 @@
"description": "Read probes in the Synthetic Monitoring app",
"permissions": [
{ "action": "plugins.app:access", "scope": "plugins:id:grafana-synthetic-monitoring-app" },
{ "action": "grafana-synthetic-monitoring-app:read" },

{ "action": "grafana-synthetic-monitoring-app.probes:read" }
]
Expand All @@ -122,6 +126,8 @@
"description": "Create, edit and delete probes in the Synthetic Monitoring app",
"permissions": [
{ "action": "plugins.app:access", "scope": "plugins:id:grafana-synthetic-monitoring-app" },
{ "action": "grafana-synthetic-monitoring-app:read" },
{ "action": "grafana-synthetic-monitoring-app:write" },

{ "action": "grafana-synthetic-monitoring-app.probes:edit" },
{ "action": "grafana-synthetic-monitoring-app.probes:read" },
Expand All @@ -136,6 +142,7 @@
"description": "Read alerts in the Synthetic Monitoring app",
"permissions": [
{ "action": "plugins.app:access", "scope": "plugins:id:grafana-synthetic-monitoring-app" },
{ "action": "grafana-synthetic-monitoring-app:read" },

{ "action": "grafana-synthetic-monitoring-app.alerts:read" }
]
Expand All @@ -148,6 +155,8 @@
"description": "Create, edit and delete alerts in the Synthetic Monitoring app",
"permissions": [
{ "action": "plugins.app:access", "scope": "plugins:id:grafana-synthetic-monitoring-app" },
{ "action": "grafana-synthetic-monitoring-app:read" },
{ "action": "grafana-synthetic-monitoring-app:write" },

{ "action": "grafana-synthetic-monitoring-app.alerts:edit" },
{ "action": "grafana-synthetic-monitoring-app.alerts:read" },
Expand All @@ -162,6 +171,7 @@
"description": "Read thresholds in the Synthetic Monitoring app",
"permissions": [
{ "action": "plugins.app:access", "scope": "plugins:id:grafana-synthetic-monitoring-app" },
{ "action": "grafana-synthetic-monitoring-app:read" },

{ "action": "grafana-synthetic-monitoring-app.thresholds:read" }
]
Expand All @@ -174,6 +184,8 @@
"description": "Read and edit thresholds in the Synthetic Monitoring app",
"permissions": [
{ "action": "plugins.app:access", "scope": "plugins:id:grafana-synthetic-monitoring-app" },
{ "action": "grafana-synthetic-monitoring-app:read" },
{ "action": "grafana-synthetic-monitoring-app:write" },

{ "action": "grafana-synthetic-monitoring-app.thresholds:edit" },
{ "action": "grafana-synthetic-monitoring-app.thresholds:read" }
Expand All @@ -187,6 +199,8 @@
"description": "Create and delete access tokens in the Synthetic Monitoring app",
"permissions": [
{ "action": "plugins.app:access", "scope": "plugins:id:grafana-synthetic-monitoring-app" },
{ "action": "grafana-synthetic-monitoring-app:read" },
{ "action": "grafana-synthetic-monitoring-app:write" },

{ "action": "grafana-synthetic-monitoring-app.access-tokens:create" },
{ "action": "grafana-synthetic-monitoring-app.access-tokens:delete" }
Expand All @@ -200,6 +214,7 @@
"description": "Read access tokens in the Synthetic Monitoring app",
"permissions": [
{ "action": "plugins.app:access", "scope": "plugins:id:grafana-synthetic-monitoring-app" },
{ "action": "grafana-synthetic-monitoring-app:read" },

{ "action": "grafana-synthetic-monitoring-app.access-tokens:read" }
]
Expand All @@ -212,6 +227,8 @@
"description": "Full access to write and manage checks, probes, alerts, thresholds, and access tokens as well as enabling/disabling the Synthetic Monitoring plugin",
"permissions": [
{ "action": "plugins.app:access", "scope": "plugins:id:grafana-synthetic-monitoring-app" },
{ "action": "grafana-synthetic-monitoring-app:read" },
{ "action": "grafana-synthetic-monitoring-app:write" },

{ "action": "grafana-synthetic-monitoring-app.plugin:enable" },
{ "action": "grafana-synthetic-monitoring-app.plugin:disable" },
Expand Down Expand Up @@ -240,6 +257,8 @@
"description": "Add, update and delete checks, probes, alerts, thresholds, and access tokens in the Synthetic Monitoring app",
"permissions": [
{ "action": "plugins.app:access", "scope": "plugins:id:grafana-synthetic-monitoring-app" },
{ "action": "grafana-synthetic-monitoring-app:read" },
{ "action": "grafana-synthetic-monitoring-app:write" },

{ "action": "grafana-synthetic-monitoring-app.checks:write" },
{ "action": "grafana-synthetic-monitoring-app.probes:write" },
Expand All @@ -266,6 +285,7 @@
"description": "Read checks, probes, alerts, thresholds, and access tokens in the Synthetic Monitoring app",
"permissions": [
{ "action": "plugins.app:access", "scope": "plugins:id:grafana-synthetic-monitoring-app" },
{ "action": "grafana-synthetic-monitoring-app:read" },

{ "action": "grafana-synthetic-monitoring-app.checks:read" },
{ "action": "grafana-synthetic-monitoring-app.probes:read" },
Expand Down

0 comments on commit eb905b0

Please sign in to comment.