Your problem with the restart is because you configure it in the constructor. But this is an Extension which is only created once at startup and not every time a check is performed.
So you will need to fill the projectTypes list in the filter method (and don’t make it a class field).
You might also consider of storing the list in LockProject class (as transient field) and just use it in the filter. In LockProject you need a to fill the list in the configure method and you need to ensure it is filled when loaded (overwrite load method probably).
From: jenkin...@googlegroups.com <jenkin...@googlegroups.com>
On Behalf Of DuMaM
Sent: Freitag, 22. März 2024 11:12
To: Jenkins Developers <jenkin...@googlegroups.com>
Subject: New plugin
|
You don't often get email from nowak.b...@gmail.com. Learn why this is important |
--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
jenkinsci-de...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/jenkinsci-dev/61bdadc2-c276-4a72-a0a0-d4017bbdc023n%40googlegroups.com.
My work environment requires from me to give users privileges to create new jobs, but I need to lock creation of non pipeline jobs.
I could take a solution proposed a long time ago by Daniel Beck, but I fought that maybe it's a good place for a more universal plugin for that purpose, so I tweaked his code a bit.