Created
November 17, 2015 08:19
-
-
Save alces/4de2a25a9ff4399a65dc to your computer and use it in GitHub Desktop.
Extract list of global permissions a particular user has from Jenkins' config.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
USERNAME = 'dummy' | |
import hudson.model.Hudson | |
println new XmlSlurper().parse( | |
new File(Hudson.instance.root, 'config.xml') | |
).authorizationStrategy.permission.collect { | |
it.text().split(':') | |
}.findAll { | |
it[1] == USERNAME | |
}.collect { | |
it[0].replaceAll(/^[a-z.]+/, '') | |
}.join(', ') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment