Skip to content

Commit

Permalink
[FIXED JENKINS-22382] Need to restore deprecated overload of BuildAut…
Browse files Browse the repository at this point in the history
…horizationToken.checkPermission for binary compatibility.
  • Loading branch information
jglick committed Mar 27, 2014
1 parent 947cbac commit 606d84c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
3 changes: 3 additions & 0 deletions changelog.html
Expand Up @@ -58,6 +58,9 @@
<li class=bug>
Incorrect filtering of build queue and executors widgets after 1.514.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-20500">issue 20500</a>)
<li class=bug>
<code>NoSuchMethodError: hudson.model.BuildAuthorizationToken.checkPermission(…)</code> from Build Token Root plugin since 1.556.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-22382">issue 22382</a>)
<li class=bug>
Fixed a slow down in resource loading caused by fix to JENKINS-18677.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-21579">issue 21579</a>)
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/hudson/model/AbstractProject.java
Expand Up @@ -1786,7 +1786,7 @@ public void doBuildWithParameters(StaplerRequest req, StaplerResponse rsp) throw
* Schedules a new SCM polling command.
*/
public void doPolling( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException {
BuildAuthorizationToken.checkPermission(this, authToken, req, rsp);
BuildAuthorizationToken.checkPermission((Job) this, authToken, req, rsp);
schedulePolling();
rsp.sendRedirect(".");
}
Expand Down
5 changes: 5 additions & 0 deletions core/src/main/java/hudson/model/BuildAuthorizationToken.java
Expand Up @@ -62,6 +62,11 @@ public static BuildAuthorizationToken create(StaplerRequest req) {
return null;
}

@Deprecated public static void checkPermission(AbstractProject<?,?> project, BuildAuthorizationToken token, StaplerRequest req, StaplerResponse rsp) throws IOException {
Job<?,?> j = project;
checkPermission(j, token, req, rsp);
}

public static void checkPermission(Job<?,?> project, BuildAuthorizationToken token, StaplerRequest req, StaplerResponse rsp) throws IOException {
if (!Jenkins.getInstance().isUseSecurity())
return; // everyone is authorized
Expand Down

0 comments on commit 606d84c

Please sign in to comment.