Skip to content

Commit

Permalink
[FIXED JENKINS-23076] hiding build with params link from users withou…
Browse files Browse the repository at this point in the history
…t build permission
  • Loading branch information
mcupak committed May 16, 2014
1 parent 545936d commit 1b52bef
Showing 1 changed file with 7 additions and 3 deletions.
Expand Up @@ -24,6 +24,10 @@
import java.util.List;

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 @@ -65,15 +69,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 1b52bef

Please sign in to comment.