Skip to content

Commit

Permalink
[FIXED JENKINS-35130] Delete and Move credentials do not work with pr…
Browse files Browse the repository at this point in the history
…oviders that do not have modifiable domains
  • Loading branch information
stephenc committed May 25, 2016
1 parent d92f392 commit 28d6d45
Showing 1 changed file with 1 addition and 4 deletions.
Expand Up @@ -1008,9 +1008,6 @@ public CredentialsStore getStore() {
@Restricted(NoExternalUse.class)
@SuppressWarnings("unused") // stapler web method
public HttpResponse doDoDelete(StaplerRequest req) throws IOException {
if (!getStore().isDomainsModifiable()) {
return HttpResponses.status(400);
}
getStore().checkPermission(DELETE);
if (getStore().removeCredentials(domain.getDomain(), credentials)) {
return HttpResponses.redirectTo("../..");
Expand All @@ -1030,7 +1027,7 @@ public HttpResponse doDoDelete(StaplerRequest req) throws IOException {
@Restricted(NoExternalUse.class)
@SuppressWarnings("unused") // stapler web method
public HttpResponse doDoMove(StaplerRequest req, @QueryParameter String destination) throws IOException {
if (!getStore().isDomainsModifiable()) {
if (getStore().getDomains().size() <= 1) {
return HttpResponses.status(400);
}
// TODO switch to Jenkins.getInstance() once 2.0+ is the baseline
Expand Down

0 comments on commit 28d6d45

Please sign in to comment.