fix only users that can edit a dashboard should be able to update panel json

This commit is contained in:
Marcus Efraimsson 2019-03-05 20:25:38 +01:00
parent 72d5215c65
commit 1a588dadbe
No known key found for this signature in database
GPG Key ID: EBFE0FB04612DD4A
2 changed files with 2 additions and 1 deletions

View File

@ -5,7 +5,7 @@ export class JsonEditorCtrl {
/** @ngInject */
constructor($scope) {
$scope.json = angular.toJson($scope.model.object, true);
$scope.canUpdate = $scope.model.updateHandler !== void 0 && $scope.contextSrv.isEditor;
$scope.canUpdate = $scope.model.updateHandler !== void 0 && $scope.model.canUpdate;
$scope.canCopy = $scope.model.enableCopy;
$scope.update = () => {

View File

@ -70,6 +70,7 @@ export const editPanelJson = (dashboard: DashboardModel, panel: PanelModel) => {
updateHandler: (newPanel: PanelModel, oldPanel: PanelModel) => {
replacePanel(dashboard, newPanel, oldPanel);
},
canUpdate: dashboard.meta.canEdit,
enableCopy: true,
};