Can anyone help me to figure out to how to write a groovy script to set 
roles through groovy script in role based strategy ?

I am able to do it for MatrixAuthorization 

def strategy = new GlobalMatrixAuthorizationStrategy()
strategy.add(Jenkins.ADMINISTER, "test")  
strategy.add(Jenkins.READ, "test")  
strategy.add(Jenkins.RUN_SCRIPTS, "test")
instance.setAuthorizationStrategy(strategy)
instance.save()

but same way if i try for RoleBasedAuthorization it doesn't work
def strategy = new 
com.michelin.cio.hudson.plugins.rolestrategy.RoleBasedAuthorizationStrategy()

Thanks,
Maneesh

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/dcc8e0d4-af2f-45af-9277-782a3b108880%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to