Skip to content

Commit

Permalink
[FIXED JENKINS-11415] Setting SVN credentials for a job should not re…
Browse files Browse the repository at this point in the history
…quire administer permission
  • Loading branch information
sogabe committed Oct 21, 2011
1 parent 222fbd6 commit 522894a
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/main/java/hudson/scm/SubversionSCM.java
Expand Up @@ -44,6 +44,7 @@
import hudson.model.Computer;
import hudson.model.Hudson;
import hudson.model.Hudson.MasterComputer;
import hudson.model.Item;
import hudson.model.Node;
import hudson.model.ParametersAction;
import hudson.model.Run;
Expand Down Expand Up @@ -1789,8 +1790,8 @@ public ISVNAuthenticationProvider createAuthenticationProvider() {
*/
// TODO: stapler should do multipart/form-data handling
public void doPostCredential(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException {
Hudson.getInstance().checkPermission(Hudson.ADMINISTER);

Hudson.getInstance().checkPermission(Item.CONFIGURE);
MultipartFormDataParser parser = new MultipartFormDataParser(req);

// we'll record what credential we are trying here.
Expand Down Expand Up @@ -1880,8 +1881,8 @@ public FormValidation doCheckRemote(StaplerRequest req, @AncestorInPath Abstract
return FormValidation.errorWithMarkup(
Messages.SubversionSCM_doCheckRemote_invalidUrl());

// Test the connection only if we have admin permission
if (!Hudson.getInstance().hasPermission(Hudson.ADMINISTER))
// Test the connection only if we have job cuonfigure permission
if (!Hudson.getInstance().hasPermission(Item.CONFIGURE))
return FormValidation.ok();

try {
Expand Down

0 comments on commit 522894a

Please sign in to comment.