Skip to content

Commit f5b83f1

Browse files
authored
[JENKINS-73276] do not allow user without admin permission to save empty form (#1572)
1 parent 4fbb009 commit f5b83f1

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/main/java/org/csanchez/jenkins/plugins/kubernetes/KubernetesFolderProperty.java

+5-4
Original file line numberDiff line numberDiff line change
@@ -74,15 +74,16 @@ public static boolean isAllowed(KubernetesSlave agent, Job job) {
7474

7575
@Override
7676
public AbstractFolderProperty<?> reconfigure(StaplerRequest req, JSONObject form) throws FormException {
77-
if (form == null) {
78-
return null;
79-
}
80-
8177
// ignore modifications silently and return the unmodified object if the user
8278
// does not have the ADMINISTER Permission
8379
if (!userHasAdministerPermission()) {
8480
return this;
8581
}
82+
83+
if (form == null) {
84+
return null;
85+
}
86+
8687
// Backwards compatibility: this method was expecting a set of entries PREFIX_USAGE_PERMISSION+cloudName -->
8788
// true | false
8889
// Now we're getting a set of permitted cloud names inside permittedClouds entry

0 commit comments

Comments
 (0)