From fe301142bab237af6b268b6267bfae17320a3019 Mon Sep 17 00:00:00 2001 From: Mitsuhiro Tanda Date: Wed, 25 Apr 2018 18:23:37 +0900 Subject: [PATCH] allow to add annotation for non editable dashboard --- public/app/plugins/panel/graph/graph.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/app/plugins/panel/graph/graph.ts b/public/app/plugins/panel/graph/graph.ts index 2de53b6dce0..41580c1deea 100755 --- a/public/app/plugins/panel/graph/graph.ts +++ b/public/app/plugins/panel/graph/graph.ts @@ -674,7 +674,7 @@ function graphDirective(timeSrv, popoverSrv, contextSrv) { return; } - if ((ranges.ctrlKey || ranges.metaKey) && dashboard.meta.canEdit) { + if ((ranges.ctrlKey || ranges.metaKey) && contextSrv.isEditor) { // Add annotation setTimeout(() => { eventManager.updateTime(ranges.xaxis); @@ -695,7 +695,7 @@ function graphDirective(timeSrv, popoverSrv, contextSrv) { return; } - if ((pos.ctrlKey || pos.metaKey) && dashboard.meta.canEdit) { + if ((pos.ctrlKey || pos.metaKey) && contextSrv.isEditor) { // Skip if range selected (added in "plotselected" event handler) let isRangeSelection = pos.x !== pos.x1; if (!isRangeSelection) {