4545import org .jenkinsci .plugins .workflow .flow .FlowExecution ;
4646import org .jenkinsci .plugins .workflow .flow .FlowExecutionOwner ;
4747import org .jenkinsci .plugins .workflow .graph .FlowNode ;
48+ import org .kohsuke .stapler .AncestorInPath ;
4849import org .kohsuke .stapler .DataBoundConstructor ;
4950import org .kohsuke .stapler .QueryParameter ;
5051import org .kohsuke .stapler .StaplerRequest ;
@@ -426,6 +427,7 @@ public boolean configure(StaplerRequest req, JSONObject formData) throws FormExc
426427 return true ;
427428 }
428429
430+ @ SuppressWarnings ({"lgtm[jenkins/csrf]" , "lgtm[jenkins/no-permission-check]" })
429431 public FormValidation doCheckCategoryName (@ QueryParameter String value ) {
430432 if (Util .fixEmptyAndTrim (value ) == null ) {
431433 return FormValidation .error ("Empty category names are not allowed." );
@@ -434,6 +436,7 @@ public FormValidation doCheckCategoryName(@QueryParameter String value) {
434436 }
435437 }
436438
439+ @ SuppressWarnings ({"lgtm[jenkins/csrf]" , "lgtm[jenkins/no-permission-check]" })
437440 public FormValidation doCheckMaxConcurrentPerNode (@ QueryParameter String value ) {
438441 return checkNullOrInt (value );
439442 }
@@ -448,6 +451,7 @@ private FormValidation checkNullOrInt(String value) {
448451 }
449452 }
450453
454+ @ SuppressWarnings ({"lgtm[jenkins/csrf]" , "lgtm[jenkins/no-permission-check]" })
451455 public FormValidation doCheckMaxConcurrentTotal (@ QueryParameter String value ) {
452456 return checkNullOrInt (value );
453457 }
@@ -479,7 +483,14 @@ public List<ThrottleCategory> getCategories() {
479483 return categories ;
480484 }
481485
482- public ListBoxModel doFillCategoryItems () {
486+ @ SuppressWarnings ("lgtm[jenkins/csrf]" )
487+ public ListBoxModel doFillCategoryItems (@ AncestorInPath Item item ) {
488+ if (item != null ) {
489+ item .checkPermission (Item .CONFIGURE );
490+ } else {
491+ Jenkins .get ().checkPermission (Jenkins .ADMINISTER );
492+ }
493+
483494 ListBoxModel m = new ListBoxModel ();
484495
485496 m .add ("(none)" , "" );
0 commit comments