Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[JENKINS-73676] Allow users with Job/CONFIGURE permission to edit remote URL #1642

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/main/java/jenkins/plugins/git/GitSCMSource.java
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,10 @@
public FormValidation doCheckRemote(@AncestorInPath Item item,
@QueryParameter String credentialsId,
@QueryParameter String remote) throws IOException, InterruptedException {
Jenkins.get().checkPermission(Jenkins.MANAGE);
if (item == null && !Jenkins.get().hasPermission(Jenkins.MANAGE) ||

Check warning on line 447 in src/main/java/jenkins/plugins/git/GitSCMSource.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Partially covered line

Line 447 is only partially covered, 4 branches are missing
item != null && !item.hasPermission(Item.CONFIGURE)) {

Check warning on line 448 in src/main/java/jenkins/plugins/git/GitSCMSource.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Partially covered line

Line 448 is only partially covered, one branch is missing
return FormValidation.warning("Not allowed to modify remote");

Check warning on line 449 in src/main/java/jenkins/plugins/git/GitSCMSource.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Not covered line

Line 449 is not covered by tests
}
return isFIPSCompliantTLS(credentialsId, remote) ? FormValidation.ok() : FormValidation.error(hudson.plugins.git.Messages.git_fips_url_notsecured());
}

Expand Down