Skip to content

Commit

Permalink
Merge pull request #7 from mcupak/build-permission-check
Browse files Browse the repository at this point in the history
[FIXED JENKINS-23076] hiding build with params link from users without b...
  • Loading branch information
mcupak committed Jul 14, 2014
2 parents 829deea + a070299 commit 7356499
Showing 1 changed file with 7 additions and 4 deletions.
Expand Up @@ -27,7 +27,10 @@
import org.kohsuke.stapler.StaplerResponse;

public class BuildWithParametersAction implements Action {

private static final String ICON_FILE_NAME = "clock.png";
private static final String DISPLAY_NAME = "Build With Params";
private static final String URL_NAME = "parambuild";

private final AbstractProject project;

public BuildWithParametersAction(AbstractProject project) {
Expand Down Expand Up @@ -81,15 +84,15 @@ ParameterValue getParameterDefinitionValue(ParameterDefinition parameterDefiniti
}

public String getIconFileName() {
return "clock.png";
return project.getACL().hasPermission(AbstractProject.BUILD) ? ICON_FILE_NAME : null;
}

public String getDisplayName() {
return "Build With Params";
return project.getACL().hasPermission(AbstractProject.BUILD) ? DISPLAY_NAME : null;
}

public String getUrlName() {
return "parambuild";
return project.getACL().hasPermission(AbstractProject.BUILD) ? URL_NAME : null;
}

//////////////////
Expand Down

0 comments on commit 7356499

Please sign in to comment.