Posted By

alces on 02/07/13


Tagged

permissions Hudson jenkins AuthorizationMatrixProperty


Versions (?)

Get user's permissions in hudson


 / Published in: Groovy
 

URL: hudson_user_perms

Getting user's permissions in Hudson

  1. USR = 'johnson' // this may be scriptler parameter
  2.  
  3. hudson.model.Hudson.instance.items.each {jb ->
  4. sec = jb.getProperty(hudson.security.AuthorizationMatrixProperty.class)
  5. if (USR in sec?.groups) {
  6. prm = sec?.grantedPermissions.findAll{USR in it.value}.keySet().name
  7. println "$jb.name: ${prm.sort().join ','}"
  8. }
  9. }
  10. "FINISHED" // for don't print too large result in console

Report this snippet  

You need to login to post a comment.