Skip to content
Permalink
Browse files

[FIXED JENKINS-44619] Don't allow replays of nonbuildable jobs

  • Loading branch information...
abayer committed Sep 18, 2017
1 parent 3396c97 commit 42f668240d5827e544768311b33b6da0fd4fb59e
@@ -139,7 +139,7 @@
<dependency>
<groupId>org.jenkins-ci.plugins.workflow</groupId>
<artifactId>workflow-job</artifactId>
<version>2.10</version>
<version>2.11.2</version>
<scope>test</scope>
</dependency>
<dependency>
@@ -115,6 +115,11 @@ private ReplayAction(Run run) {
if (!run.hasPermission(REPLAY)) {
return false;
}

if (!run.getParent().isBuildable()) {
return false;
}

CpsFlowExecution exec = getExecution();
if (exec == null) {
return false;
@@ -171,6 +171,12 @@ public static void assertPermissionId() {
assertTrue(canReplay(b2, "dev1"));
assertTrue(canReplay(b2, "dev2"));
assertFalse(canReplay(b2, "dev3"));
// Disable the job and verify that no one can replay it.
p.makeDisabled(true);
assertFalse(canReplay(b2, "admin"));
assertFalse(canReplay(b2, "dev1"));
assertFalse(canReplay(b2, "dev2"));
assertFalse(canReplay(b2, "dev3"));
}
});
}

0 comments on commit 42f6682

Please sign in to comment.
You can’t perform that action at this time.