Hi @Russell Kent
Welcome to the Community.
Here is a modified script based on the one in the library that will print out all the permissions for the selected group:
import groovy.xml.MarkupBuilderimport com.atlassian.confluence.internal.security.SpacePermissionManagerInternalimport com.atlassian.confluence.security.SpacePermissionManagerimport com.atlassian.crowd.embedded.api.Groupimport com.atlassian.sal.api.component.ComponentLocatorimport com.onresolve.scriptrunner.parameters.annotation.GroupPicker@GroupPicker(label = 'Group', description = 'Select the group to inspect')Group selectedGroupassert selectedGroupdef spacePermissionManager = ComponentLocator.getComponent(SpacePermissionManager) as SpacePermissionManagerInternaldef groupPermissions = spacePermissionManager.getAllPermissionsForGroup(selectedGroup.name)def writer = new StringWriter()def builder = new MarkupBuilder(writer)builder.table(class: 'aui') { thead { tr { th 'Space' th 'Space Name' th 'Space Type' th 'Permission' } } tbody { groupPermissions.each { permission -> if (!permission.space) return //don't print out non space permissions tr { td permission.space.key td permission.space.name td permission?.space?.spaceType td permission.type } } }}writer.toString()
I'm using the groovy markup builder to create a simple HTML table to output the data in a user-friendly way
It looks like you're new here. Sign in or register to get started.