Re: How to identify admins on Jenkins using groovy scripts

2016-11-13 Thread Stas Roshkolets
Hi Oleg, Thank you for fast response :) On Friday, November 11, 2016 at 7:24:05 PM UTC+2, Oleg Nenashev wrote: > > Hi Stas, > > You do not impersonate within the script, hence your code actually checks > if the *current user* has *ADMINISTER* permission fo *user u*. > > Example of a working

Re: How to identify admins on Jenkins using groovy scripts

2016-11-11 Thread Oleg Nenashev
Hi Stas, You do not impersonate within the script, hence your code actually checks if the *current user* has *ADMINISTER* permission fo *user u*. Example of a working code:

How to identify admins on Jenkins using groovy scripts

2016-11-10 Thread Stas Roshkolets
Hello, I am trying to write Groovy script that will identify users that they are assigned as admins in Jenkins : import jenkins.model.Jenkinsimport hudson.model.Userimport hudson.security.Permission allUsers = User.getAll() adminList = []for (u in allUsers) { if