Hi,
I am currently working on a macro that displays all groups with "VIEWSPACE" and "SETSPACEPERMISSIONS" permissions. I have already implemented it, however it seems to be way to heavy for our server.
Here some parts of the code:
#foreach ($permission in $space.getPermissions())
#if ($permission.isGroupPermission() && $permission.getType() == "SETSPACEPERMISSIONS")
#set ( $groupString = $permission.getGroup() )
#set ( $groupObject = $userAccessor.getGroup($groupString) )
#set ( $memberList = $userAccessor.getMemberNamesAsList($groupObject) )
As you can see, I get the groups by retrieving all permissions of the space at first.
In the Java API, I realized that the spacePermissionManager offers the following Method: <span><a href="https://docs.atlassian.com/ConfluenceServer/javadoc/7.3.3/com/atlassian/confluence/security/SpacePermissionManager.html#getGroupsForPermissionType-java.lang.String-com.atlassian.confluence.spaces.Space-" target="_blank" rel="noopener nofollow noreferrer">getGroupsForPermissionType</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" target="_blank" rel="noopener nofollow noreferrer" title="class or interface in java.lang">String</a> permissionType, <a href="https://docs.atlassian.com/ConfluenceServer/javadoc/7.3.3/com/atlassian/confluence/spaces/Space.html" target="_blank" rel="noopener nofollow noreferrer" title="class in com.atlassian.confluence.spaces">Space</a> space)
This is exactly what I need. Also the $action object holds a spacePermissionManager unfortunately I am not able to use it, as no getter is available. Is there a specific reason for that? Is there any other way to obtain the spacePermissionManager?