Skip to content

Commit

Permalink
Allow collaborators to update query schedule.
Browse files Browse the repository at this point in the history
  • Loading branch information
arikfr committed Sep 3, 2017
1 parent 47fc661 commit 6b56e4a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
1 change: 0 additions & 1 deletion client/app/pages/queries/source-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()}`;

Expand Down
3 changes: 2 additions & 1 deletion client/app/pages/queries/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit 6b56e4a

Please sign in to comment.