1
0
Fork 0
mirror of https://github.com/NixOS/hydra.git synced 2024-10-18 17:02:28 -04:00

allow users with 'restart-jobs' role to restart individual builds

This commit is contained in:
Andreas Rammhold 2018-10-04 21:59:42 +02:00
parent e0f204f3da
commit 63a294d4ca
No known key found for this signature in database
GPG key ID: E432E410B5E48C86

View file

@ -493,7 +493,7 @@ sub nix : Chained('buildChain') PathPart('nix') CaptureArgs(0) {
sub restart : Chained('buildChain') PathPart Args(0) { sub restart : Chained('buildChain') PathPart Args(0) {
my ($self, $c) = @_; my ($self, $c) = @_;
my $build = $c->stash->{build}; my $build = $c->stash->{build};
requireProjectOwner($c, $build->project); requireRestartPrivileges($c, $build->project);
my $n = restartBuilds($c->model('DB')->schema, $c->model('DB::Builds')->search({ id => $build->id })); my $n = restartBuilds($c->model('DB')->schema, $c->model('DB::Builds')->search({ id => $build->id }));
error($c, "This build cannot be restarted.") if $n != 1; error($c, "This build cannot be restarted.") if $n != 1;
$c->flash->{successMsg} = "Build has been restarted."; $c->flash->{successMsg} = "Build has been restarted.";