The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

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

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

TAGS
AUG Leaders

Atlassian Community Events