Retrieve spacePermissionManager

Björn Sauter March 23, 2020

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: getGroupsForPermissionType(String permissionType, Space 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?

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events