Skip to content

Commit

Permalink
Merge pull request #52 from tknerr/whitelist-keeplog-property
Browse files Browse the repository at this point in the history
Whitelist the isKeepLog and setKeepLog properties (JENKINS-49014)
  • Loading branch information
abayer committed Feb 20, 2018
2 parents d1e2e2b + aa19411 commit 385508e
Showing 1 changed file with 16 additions and 1 deletion.
Expand Up @@ -107,6 +107,16 @@ public void setDisplayName(String n) throws IOException {
build().setDisplayName(n);
}
}

@Whitelisted
public void setKeepLog(boolean b) throws IOException {
if (!currentBuild) {
throw new SecurityException("can only set the keepLog property on the current build");
}
try (ACLContext ctx = ACL.as(ACL.SYSTEM)) {
build().keepLog(b);
}
}

@Whitelisted
public int getNumber() throws AbortException {
Expand Down Expand Up @@ -179,7 +189,12 @@ public String getDisplayName() throws AbortException {
public String getFullDisplayName() throws AbortException {
return build().getFullDisplayName();
}


@Whitelisted
public boolean isKeepLog() throws AbortException {
return build().isKeepLog();
}

@Whitelisted
public String getProjectName() throws AbortException {
return build().getParent().getName();
Expand Down

0 comments on commit 385508e

Please sign in to comment.