Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

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

Krishna Gottapu 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

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 Leaders.
May 12, 2022

Hi @Krishna Gottapu 

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

Regards, Dominic

Krishna Gottapu May 13, 2022

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events