Skip to content

Commit 2191c4c

Browse files
authored
Merge pull request #256 from jenkinsci/replace-RUN_SCRIPTS-with-ADMINISTER
replace RUN_SCRIPTS with ADMINISTER
2 parents b030909 + 47f0d3e commit 2191c4c

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/main/java/com/cloudbees/jenkins/plugins/sshcredentials/impl/BasicSSHUserPrivateKey.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ private Object readResolve() {
443443
return new DirectEntryPrivateKeySource(privateKeyFile);
444444
}
445445

446-
Jenkins.get().checkPermission(Jenkins.RUN_SCRIPTS);
446+
Jenkins.get().checkPermission(Jenkins.ADMINISTER);
447447

448448
LOGGER.log(Level.INFO, "SECURITY-440: Migrating FileOnMasterPrivateKeySource to DirectEntryPrivateKeySource");
449449
// read the content of the file and then migrate to Direct
@@ -530,7 +530,7 @@ public long getPrivateKeysLastModified() {
530530
}
531531

532532
private Object readResolve() {
533-
Jenkins.get().checkPermission(Jenkins.RUN_SCRIPTS);
533+
Jenkins.get().checkPermission(Jenkins.ADMINISTER);
534534

535535
LOGGER.log(Level.INFO, "SECURITY-440: Migrating UsersPrivateKeySource to DirectEntryPrivateKeySource");
536536
// read the content of the file and then migrate to Direct

src/test/java/com/cloudbees/jenkins/plugins/sshcredentials/impl/BasicSSHUserPrivateKeyTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ public void userWithoutRunScripts_cannotMigrateDangerousPrivateKeySource() throw
9898
.withStdin(updateFolder.read())
9999
.invokeWithArgs("folder1");
100100

101-
assertThat(result.stderr(), containsString("user is missing the Overall/RunScripts permission"));
101+
assertThat(result.stderr(), containsString("user is missing the Overall/Administer permission"));
102102
assertThat(result, failedWith(1));
103103

104104
// config file not touched

0 commit comments

Comments
 (0)