Allow collaborators to update query schedule.

This commit is contained in:
Arik Fraimovich 2017-09-03 14:31:42 +03:00
parent 47fc6612bf
commit 6b56e4a3e3
2 changed files with 2 additions and 2 deletions

View File

@ -16,7 +16,6 @@ function QuerySourceCtrl(Events, toastr, $controller, $scope, $location, $http,
const saveQuery = $scope.saveQuery;
$scope.sourceMode = true;
$scope.canEdit = currentUser.canEdit($scope.query) || $scope.query.can_edit;
$scope.isDirty = false;
$scope.base_url = `${$location.protocol()}://${$location.host()}:${$location.port()}`;

View File

@ -135,6 +135,7 @@ function QueryViewCtrl($scope, Events, $route, $routeParams, $location, $window,
$scope.queryExecuting = false;
$scope.isQueryOwner = (currentUser.id === $scope.query.user.id) || currentUser.hasPermission('admin');
$scope.canEdit = currentUser.canEdit($scope.query) || $scope.query.can_edit;
$scope.canViewSource = currentUser.hasPermission('view_source');
$scope.canExecuteQuery = () => currentUser.hasPermission('execute_query') && !$scope.dataSource.view_only;
@ -333,7 +334,7 @@ function QueryViewCtrl($scope, Events, $route, $routeParams, $location, $window,
}
$scope.openScheduleForm = () => {
if (!$scope.isQueryOwner || !$scope.canScheduleQuery) {
if (!$scope.canEdit || !$scope.canScheduleQuery) {
return;
}