diff --git a/public/app/features/dashboard/viewStateSrv.js b/public/app/features/dashboard/viewStateSrv.js index ef7669e387c..e87a942a6de 100644 --- a/public/app/features/dashboard/viewStateSrv.js +++ b/public/app/features/dashboard/viewStateSrv.js @@ -130,10 +130,11 @@ function (angular, _, $) { var docHeight = $(window).height(); var editHeight = Math.floor(docHeight * 0.3); var fullscreenHeight = Math.floor(docHeight * 0.7); - this.oldTimeRange = panelScope.range; - panelScope.height = this.state.edit ? editHeight : fullscreenHeight; - panelScope.editMode = this.state.edit; + panelScope.editMode = this.state.edit && this.$scope.dashboardMeta.canEdit; + panelScope.height = panelScope.editMode ? editHeight : fullscreenHeight; + + this.oldTimeRange = panelScope.range; this.fullscreenPanel = panelScope; $(window).scrollTop(0); diff --git a/public/app/features/panel/panelMenu.js b/public/app/features/panel/panelMenu.js index 03ee78491ab..5a701084ff3 100644 --- a/public/app/features/panel/panelMenu.js +++ b/public/app/features/panel/panelMenu.js @@ -8,7 +8,7 @@ function (angular, $, _) { angular .module('grafana.directives') - .directive('panelMenu', function($compile, linkSrv, contextSrv) { + .directive('panelMenu', function($compile, linkSrv) { var linkTemplate = '' + '{{panel.title | interpolateTemplateVars:this}}' + @@ -19,7 +19,7 @@ function (angular, $, _) { function createMenuTemplate($scope) { var template = '
'; - if ($scope.dashboardMeta.canEdit && contextSrv.isEditor) { + if ($scope.dashboardMeta.canEdit) { template += '
'; template += '
'; template += ''; @@ -34,7 +34,7 @@ function (angular, $, _) { _.each($scope.panelMeta.menu, function(item) { // skip edit actions if not editor - if (item.role === 'Editor' && (!contextSrv.isEditor || !$scope.dashboardMeta.canEdit)) { + if (item.role === 'Editor' && !$scope.dashboardMeta.canEdit) { return; } diff --git a/public/app/features/panel/panelSrv.js b/public/app/features/panel/panelSrv.js index d29866033ee..b863518ff72 100644 --- a/public/app/features/panel/panelSrv.js +++ b/public/app/features/panel/panelSrv.js @@ -71,14 +71,6 @@ function (angular, _, config) { }; $scope.toggleFullscreen = function(edit) { - if (edit && $scope.dashboardMeta.canEdit === false) { - $scope.appEvent('alert-warning', [ - 'Dashboard not editable', - 'Use Save As.. feature to create an editable copy of this dashboard.' - ]); - return; - } - $scope.dashboardViewState.update({ fullscreen: true, edit: edit, panelId: $scope.panel.id }); };