mirror of
https://github.com/grafana/grafana.git
synced 2025-02-09 06:56:07 -06:00
fix only users that can edit a dashboard should be able to update panel json
This commit is contained in:
parent
72d5215c65
commit
1a588dadbe
@ -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 = () => {
|
||||
|
@ -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,
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user