ソースを参照

use canMakeEditable

Mitsuhiro Tanda 7 年 前
コミット
87c9c47579
1 ファイル変更2 行追加2 行削除
  1. 2 2
      public/app/plugins/panel/graph/graph.ts

+ 2 - 2
public/app/plugins/panel/graph/graph.ts

@@ -674,7 +674,7 @@ function graphDirective(timeSrv, popoverSrv, contextSrv) {
           return;
           return;
         }
         }
 
 
-        if ((ranges.ctrlKey || ranges.metaKey) && contextSrv.isEditor) {
+        if ((ranges.ctrlKey || ranges.metaKey) && (dashboard.meta.canEdit || dashboard.meta.canMakeEditable)) {
           // Add annotation
           // Add annotation
           setTimeout(() => {
           setTimeout(() => {
             eventManager.updateTime(ranges.xaxis);
             eventManager.updateTime(ranges.xaxis);
@@ -695,7 +695,7 @@ function graphDirective(timeSrv, popoverSrv, contextSrv) {
           return;
           return;
         }
         }
 
 
-        if ((pos.ctrlKey || pos.metaKey) && contextSrv.isEditor) {
+        if ((pos.ctrlKey || pos.metaKey) && (dashboard.meta.canEdit || dashboard.meta.canMakeEditable)) {
           // Skip if range selected (added in "plotselected" event handler)
           // Skip if range selected (added in "plotselected" event handler)
           let isRangeSelection = pos.x !== pos.x1;
           let isRangeSelection = pos.x !== pos.x1;
           if (!isRangeSelection) {
           if (!isRangeSelection) {