Created
July 30, 2013 13:13
-
-
Save whittlec/6112778 to your computer and use it in GitHub Desktop.
Apply permissions to users in Jenkins using matrix authorization strategy
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
strategy = Hudson.instance.authorizationStrategy; | |
if (strategy instanceof hudson.security.GlobalMatrixAuthorizationStrategy) { | |
for (user in ["bob", "mike"]) { | |
for (perm in ["hudson.model.Hudson.Read", | |
"hudson.model.Item.Read", | |
"hudson.model.Item.Build", | |
"hudson.model.Item.Workspace", | |
"hudson.model.Run.Delete", | |
"hudson.model.Run.Update", | |
"hudson.model.View.Configure", | |
"hudson.model.View.Create", | |
"hudson.model.View.Delete", | |
"hudson.scm.SCM.Tag"]) { | |
strategy.add(hudson.security.Permission.fromId(perm), user); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment