Skip to content

Commit e015312

Browse files
authored
[JENKINS-73676] Allow users with Job/CONFIGURE permission to edit remote URL (#1642)
Changes for FIPS mistakenly placed the requirement for administrator on the field when it previously allowed users with Job/CONFIGURE permission to modify the field.
1 parent c380f5b commit e015312

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/main/java/jenkins/plugins/git/GitSCMSource.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,10 @@ public ListBoxModel doFillCredentialsIdItems(@AncestorInPath Item context,
444444
public FormValidation doCheckRemote(@AncestorInPath Item item,
445445
@QueryParameter String credentialsId,
446446
@QueryParameter String remote) throws IOException, InterruptedException {
447-
Jenkins.get().checkPermission(Jenkins.MANAGE);
447+
if (item == null && !Jenkins.get().hasPermission(Jenkins.MANAGE) ||
448+
item != null && !item.hasPermission(Item.CONFIGURE)) {
449+
return FormValidation.warning("Not allowed to modify remote");
450+
}
448451
return isFIPSCompliantTLS(credentialsId, remote) ? FormValidation.ok() : FormValidation.error(hudson.plugins.git.Messages.git_fips_url_notsecured());
449452
}
450453

0 commit comments

Comments
 (0)