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 (u.hasPermission(Jenkins.ADMINISTER)) {
 // if (u.canDelete()) {
   adminList.add(u)
  }}
println allUsers 
println adminList


Both lists allUsers, adminList print all users in the system...

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/dbb107f4-d7f4-4c7f-b64f-f20bb3d5bba5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to