Skip to content
Permalink
Browse files

Fix JENKINS-15171

  • Loading branch information...
gboissinot committed Sep 16, 2012
1 parent c1f712c commit 90e72c36deb02f7b49e55b324784f8cf7b6d74c7
@@ -2,6 +2,8 @@

import hudson.model.AbstractProject;
import hudson.model.Action;
import hudson.model.Item;
import org.acegisecurity.AccessDeniedException;
import org.kohsuke.stapler.StaplerProxy;

/**
@@ -24,7 +26,12 @@ public String getDisplayName() {
}

public String getUrlName() {
return "dryRun";
try {
target.checkPermission(Item.BUILD);
return "dryRun";
} catch (AccessDeniedException ae) {
return null;
}
}

public Object getTarget() {
@@ -1,6 +1,7 @@
package org.jenkinsci.plugins.dryrun;

import hudson.model.AbstractProject;
import hudson.model.Item;
import org.kohsuke.stapler.StaplerRequest;
import org.kohsuke.stapler.StaplerResponse;

@@ -21,6 +22,7 @@ public DryRunUserAction(AbstractProject project) {

@SuppressWarnings("unused")
public void doDynamic(String token, StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException {
project.checkPermission(Item.BUILD);
project.scheduleBuild(0, new DryRunCause(), new DryRunActivateListenerAction(), new DryRunBuildBadgeAction());
rsp.forwardToPreviousPage(req);
}

0 comments on commit 90e72c3

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