just for future reference and others having the some trouble...
i had to "import hudson.model.*" too, and the error was gone.
Am Mittwoch, 9. März 2016 21:12:25 UTC+1 schrieb str...@gmail.com:
>
> Hi,
>
> any solution to this? Im running into the same problem, via script-console
> its working,
Hi,
any solution to this? Im running into the same problem, via script-console
its working, but even after a restart i get the following error:
Mar 09, 2016 9:10:32 PM jenkins.util.groovy.GroovyHookScript execute
WARNING: Failed to run script
file:/var/jenkins_home/init.groovy.d/50_active-direc
On Thursday, 20 August 2015 13:47:05 UTC+1, Anthony Green wrote:
>
> This was my solution
>
> import jenkins.model.*
> import hudson.security.*
>
> def instance = Jenkins.getInstance()
>
> def strategy = new GlobalMatrixAuthorizationStrategy()
> strategy.add(Jenkins.ADMINISTER, "foo")
> s
This was my solution
import jenkins.model.*
import hudson.security.*
def instance = Jenkins.getInstance()
def strategy = new GlobalMatrixAuthorizationStrategy()
strategy.add(Jenkins.ADMINISTER, "foo")
strategy.add(Jenkins.READ, 'baz')
strategy.add(Item.DISCOVER, 'baz')
strategy.a
Has anyone managed to script the authorisation levels of a user with Groovy?
I have the beginnings of a script:
import jenkins.model.*
import hudson.security.*
def instance = Jenkins.getInstance()
def hudsonRealm = new HudsonPrivateSecurityRealm(false)
instance.setSecurityRealm(hudsonRealm)
hu