Skip to content

Commit 5b72391

Browse files
committed
Add missing permission check step in global configuration setup
1 parent bc731f6 commit 5b72391

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/main/java/io/jenkins/plugins/cloudaeye/CloudAEyeGlobalKeyConfiguration.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import java.util.logging.Logger;
1111
import javax.servlet.ServletException;
1212
import jenkins.model.GlobalConfiguration;
13+
import jenkins.model.Jenkins;
1314
import org.apache.commons.lang.StringUtils;
1415
import org.apache.http.HttpResponse;
1516
import org.apache.http.util.EntityUtils;
@@ -64,6 +65,9 @@ public void setToken(Secret token) {
6465
* @return Valid form
6566
*/
6667
public FormValidation doCheckTenantKey(@QueryParameter String tenantKey) {
68+
if (!Jenkins.get().hasPermission(Jenkins.ADMINISTER)) {
69+
return FormValidation.ok();
70+
}
6771
if (StringUtils.isEmpty(tenantKey)) {
6872
return FormValidation.warning("Please specify a valid tenant key");
6973
}

0 commit comments

Comments
 (0)