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: 

How to get SpacePermissions using Java Confluence API (> 7.3.0)

Krishna Gottapu
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 12, 2022

Earlier we used to get Space Permissions using below code

com.atlassian.confluence.spaces.Space space = spaceManager.getSpace(spaceKey);

List<SpacePermission> spList = space.getPermissions();

But now we are upgrading to Confluence 7.13.4 and spaceManager.getSpace(spaceKey) is deprecated and I can't find a way to pull com.atlassian.confluence.spaces.Space which has most of the information. 

According to Confluence 7.13.4 API ( https://docs.atlassian.com/ConfluenceServer/javadoc/7.13.4/com/atlassian/confluence/spaces/SpaceManager.html#getSpace-java.lang.String- )  " since 7.3.0, use SpaceService.find(Expansion...) in plugins and SpaceManagerInternal in core where applicable ", So when I use above method to pull Space it returns a new Space ( com.atlassian.confluence.api.model.content.Space) class instance with minimum details unlike old one. 

When I try to use SpacePermissionManager  (https://docs.atlassian.com/ConfluenceServer/javadoc/7.13.4/com/atlassian/confluence/security/SpacePermissionManager.html) or  PermissionManager methods accept only com.atlassian.confluence.spaces.Space but not new Space ( com.atlassian.confluence.api.model.content.Space)

Without the old Space (com.atlassian.confluence.spaces.Space) class I couldn't find a way to pull SpacePermissions.

Thanks in advance!!

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Dominic Lagger
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
May 12, 2022

Hi @Krishna Gottapu 

I would suggest to you to ask this question in the developer community

Regards, Dominic

Krishna Gottapu
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 13, 2022
TAGS
AUG Leaders

Atlassian Community Events