How to get Space Permissions?
Asked by Catherine Mora:

Do any if you know if there is a method in Confluence similar to getContentPermissionSets(String token, String contentId) to get the users or groups which have access to a Space? I can extract the ones for pages with this method but I also need to get Spaces permissions as well

I've checked the documentation and there are methods like:

\* getSpaceLevelPermissions(String token)  
\* getPermissionsForUser(String token, String spaceKey, String userName)   
\* getPermissions(String token, String spaceKey)

But they are not useful as they give permissions for the current user or provides a list of permissions that may be granted to a space.

Thanks in advance for any help!


Answers:
author: Bob Swift (personal)
body: You are taking about remote APIs. No, not directly. But you can use [getSpacePermissionList](https://bobswift.atlassian.net/wiki/display/CSOAP/Documentation#Documentation-getSpacePermissionList) from [Confluence Command Line Interface](https://bobswift.atlassian.net/wiki/display/CSOAP) or use a similar technique.

comments: author: Catherine Mora
body: Thanks Bob. Is there any limitation regarding the Confluence Version? I'm using version 3.5.5


author: Bob Swift (personal)
body: Shouldn't be. But you are using OnDemand - so your Confluence version is 4.2.x isn't it?


author: Catherine Mora
body: I tried the method and I'm getting the permissions information thanks for the suggestion!

This is what my Confluence says: Atlassian Confluence 3.5.5. So I'm not sure what you mean by that other version


author: Bob Swift (personal)
body: Well, your question says you are an OnDemand user, so that is why I thought you would be on the current OnDemand version of Confluence. No matter though.


author: Catherine Mora
body: Hi Bob thanks again for the info, just one last thing. I tried your app with Confluence 3.3 and most of the methods except the *getSpacePermissionList*. I get:

"Client error: This action requires the Confluence release level 3.5 or higher. The release level of this server is 3.3."

Is there any restriction with the API for version 3.3 that avoids getting this information? I'm using the latest version of the Command Line app. I'm asking because I need to find a way to extract space permissions for Confluence 3.3, so if the Command line doesn't work I would have to create a plugin to extract this info. I was thinking about the **[getGroupsWithPermissions](http://docs.atlassian.com/atlassian-confluence/3.3/com/atlassian/confluence/security/SpacePermissionManager.html#getGroupsWithPermissions%28com.atlassian.confluence.spaces.Space%29) and****[getUsersWithPermissions](http://docs.atlassian.com/atlassian-confluence/3.3/com/atlassian/confluence/security/SpacePermissionManager.html#getUsersWithPermissions%28com.atlassian.confluence.spaces.Space%29)** methods in here <http://docs.atlassian.com/atlassian-confluence/3.3/com/atlassian/confluence/security/SpacePermissionManager.html>.

From your experience, do you think this would work? Or am I doing something wrong with the Command Line app?

Thanks in advance


author: Bob Swift (personal)
body: You said earlier you were on 3.5.5? The CLI will only support this capability on 3.5.x and above as older releases were not compatible with the implementation. There are no remote APIs for this capability, the implementation renders the screens. You could customize the implementation for your specific version, but I don't have time to help you with that at this time.


author: Catherine Mora
body: Yes, I tried it with 3.5 before but the code I'm writing has to work also for 3.3 version (sorry for the confusion). I don't need to extract this information to display it in the UI.

I'm trying to build a Confluence connector and for each document I need to extract the ACLs. I have what I need for Pages but the SOAP API doesn't provide the ACLs for Spaces, so I was planning to use your CLI but since it is not compatible with version 3.3 I have to build my own plugin to get this information. So basically my question was that if you were aware of any kind of restriction with the API and versions prior 3.5 that I should considered or if it is not even possible to get this Space information if I'm using version 3.3

Thanks again for all the information!


author: Bob Swift (personal)
body: You are taking about remote APIs. No, not directly. But you can use [getSpacePermissionList](https://bobswift.atlassian.net/wiki/display/CSOAP/Documentation#Documentation-getSpacePermissionList) from [Confluence Command Line Interface](https://bobswift.atlassian.net/wiki/display/CSOAP) or use a similar technique.


author: Bob Swift (personal)
body: You are taking about remote APIs. No, not directly. But you can use [getSpacePermissionList](https://bobswift.atlassian.net/wiki/display/CSOAP/Documentation#Documentation-getSpacePermissionList) from [Confluence Command Line Interface](https://bobswift.atlassian.net/wiki/display/CSOAP) or use a similar technique.


Tags: cloud

confluence-cloud