How can I toggle on Jenkins' Enable Slave -> Master Access Control (listed under Configure System), control from a Groovy script run using the script console?
I suspect the answer will involve the MasterKillSwitchConfiguration class.
Answer is:
Jenkins.instance.injector.getInstance(AdminWhitelistRule.class)
.setMasterKillSwitch(false);
Jenkins.instance.save()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With