forked from lix-project/hydra
allow users with 'restart-jobs' role to restart individual builds
This commit is contained in:
parent
e0f204f3da
commit
63a294d4ca
|
@ -493,7 +493,7 @@ sub nix : Chained('buildChain') PathPart('nix') CaptureArgs(0) {
|
|||
sub restart : Chained('buildChain') PathPart Args(0) {
|
||||
my ($self, $c) = @_;
|
||||
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 }));
|
||||
error($c, "This build cannot be restarted.") if $n != 1;
|
||||
$c->flash->{successMsg} = "Build has been restarted.";
|
||||
|
|
Loading…
Reference in a new issue