Created
November 9, 2020 05:24
-
-
Save alipandidan/d6390841b4ecb46a7a6fc61fb2fe5197 to your computer and use it in GitHub Desktop.
Jenkins list groups on all items
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
// It's 6:00 and I haven't slep, I'll clean it later | |
// import nectar.plugins.rbac.groups.* | |
// import com.cloudbees.hudson.plugins.folder.* | |
// import com.cloudbees.jenkins.plugins.foldersplus.* | |
// import com.cloudbees.hudson.plugins.folder.properties.FolderProxyGroupContainer | |
// import nectar.plugins.rbac.groups.JobProxyGroupContainer | |
// for (item in Jenkins.instance.getAllItems()) { | |
// if (item instanceof com.cloudbees.hudson.plugins.folder.Folder) { | |
// AbstractFolder < ? > folderAbs1 = AbstractFolder.class.cast(item) | |
// FolderProxyGroupContainer propertyFPG = folderAbs1.getProperties().get(FolderProxyGroupContainer.class) | |
// if (propertyFPG != null) { | |
// propertyFPG.getGroups().findAll{it != null}.each { | |
// println item.fullName + " : " + it.name | |
// } | |
// } | |
// } else { | |
// // def locationJob = Jenkins.instance.getAllItems().find{it.fullName.equals(item.fullName)} | |
// // GroupContainer container = GroupContainerLocator.locate(locationJob) | |
// def groupContainers = item.getProperties().get(com.cloudbees.hudson.plugins.modeling.integrations.rbac.ModelProxyGroupContainer.class) | |
// println groupContainers.groups | |
// } | |
// } | |
// if (propertyFPG != null) { | |
// println propertyFPG.getGroups().findAll{it != null}.collect { it.name }.join(',') | |
// } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment