Skip to content

Commit a29b017

Browse files
authored
make the MANAGE permission enabled by default (#23873)
* make the MANAGE permission enabled by default Removed experimental warning for MANAGE permission and enable it by default. * update tests to accomodate enabling of Overall/Manage
1 parent f075bc0 commit a29b017

File tree

6 files changed

+6
-9
lines changed

6 files changed

+6
-9
lines changed

core/src/main/java/jenkins/model/Jenkins.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5862,15 +5862,12 @@ public boolean shouldShowStackTrace() {
58625862
* are unsafe to make available to users with only this permission,
58635863
* as they could be used to bypass permission enforcement and elevate permissions.</p>
58645864
*
5865-
* <p>This permission is disabled by default and support for it considered experimental.
5866-
* Administrators can set the system property {@code jenkins.security.ManagePermission} to enable it.</p>
5867-
*
58685865
* @since 2.222
58695866
*/
58705867
public static final Permission MANAGE = new Permission(PERMISSIONS, "Manage",
58715868
Messages._Jenkins_Manage_Description(),
58725869
ADMINISTER,
5873-
SystemProperties.getBoolean("jenkins.security.ManagePermission"),
5870+
true,
58745871
new PermissionScope[]{PermissionScope.JENKINS});
58755872

58765873
/**

test/src/test/java/hudson/cli/CancelQuietDownCommandTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ void cancelQuietDownShouldFailWithoutAdministerPermission() {
6464
.invoke();
6565
assertThat(result, failedWith(6));
6666
assertThat(result, hasNoStandardOutput());
67-
assertThat(result.stderr(), containsString("ERROR: user is missing the Overall/Administer permission"));
67+
assertThat(result.stderr(), containsString("ERROR: user is missing the Overall/Manage permission"));
6868
}
6969

7070
@Test

test/src/test/java/hudson/cli/QuietDownCommandTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ void quietDownShouldFailWithoutAdministerPermission() {
9090
.invoke();
9191
assertThat(result, failedWith(6));
9292
assertThat(result, hasNoStandardOutput());
93-
assertThat(result.stderr(), containsString("ERROR: " + VIEWER + " is missing the Overall/Administer permission"));
93+
assertThat(result.stderr(), containsString("ERROR: " + VIEWER + " is missing the Overall/Manage permission"));
9494
}
9595

9696
@Test

test/src/test/java/hudson/cli/ReloadConfigurationCommandTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ void reloadConfigurationShouldFailWithoutAdministerPermission() {
8181

8282
assertThat(result, failedWith(6));
8383
assertThat(result, hasNoStandardOutput());
84-
assertThat(result.stderr(), containsString("user is missing the Overall/Administer permission"));
84+
assertThat(result.stderr(), containsString("user is missing the Overall/Manage permission"));
8585
}
8686

8787
@Test

test/src/test/java/hudson/security/ACLTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ void checkAnyPermissionDoesNotShowDisabledPermissionsInError() {
136136
try (ACLContext ignored = ACL.as2(manager.impersonate2())) {
137137
Exception e = assertThrows(AccessDeniedException.class,
138138
() -> jenkins.getACL().checkAnyPermission(Jenkins.MANAGE, Jenkins.SYSTEM_READ));
139-
assertEquals("manager is missing the Overall/Administer permission", e.getMessage());
139+
assertEquals("manager is missing a permission, one of Overall/Manage, Overall/Administer is required", e.getMessage());
140140
}
141141
}
142142

test/src/test/java/jenkins/security/StackTraceSuppressionTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ void authenticationManageException() throws Exception {
7676
HtmlPage page = wc.goTo("manage");
7777

7878
String content = page.getWebResponse().getContentAsString();
79-
assertThat(content, containsString(alice.getId() + " is missing the Overall/Administer permission"));
79+
assertThat(content, containsString(alice.getId() + " is missing a permission, one of Overall/Manage, Overall/Administer is required"));
8080
assertThat(content, not(containsString("Caused by")));
8181
}
8282

0 commit comments

Comments
 (0)