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.MarkupBuilder
import com.atlassian.confluence.internal.security.SpacePermissionManagerInternal
import com.atlassian.confluence.security.SpacePermissionManager
import com.atlassian.crowd.embedded.api.Group
import com.atlassian.sal.api.component.ComponentLocator
import com.onresolve.scriptrunner.parameters.annotation.GroupPicker
@GroupPicker(label = 'Group', description = 'Select the group to inspect')
Group selectedGroup
assert selectedGroup
def spacePermissionManager = ComponentLocator.getComponent(SpacePermissionManager) as SpacePermissionManagerInternal
def 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
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.