How to get Space Permissions?

Catherine Mora June 10, 2012

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!

3 answers

1 accepted

0 votes
Answer accepted
Bob Swift OSS (Bob Swift Atlassian Apps)
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.
June 11, 2012

You are taking about remote APIs. No, not directly. But you can use getSpacePermissionList from Confluence Command Line Interface or use a similar technique.

Catherine Mora June 11, 2012

Thanks Bob. Is there any limitation regarding the Confluence Version? I'm using version 3.5.5

Bob Swift OSS (Bob Swift Atlassian Apps)
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.
June 11, 2012

Shouldn't be. But you are using OnDemand - so your Confluence version is 4.2.x isn't it?

Catherine Mora June 11, 2012

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

Bob Swift OSS (Bob Swift Atlassian Apps)
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.
June 11, 2012

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.

Catherine Mora June 12, 2012

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 and getUsersWithPermissions 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

Bob Swift OSS (Bob Swift Atlassian Apps)
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.
June 12, 2012

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.

Catherine Mora June 12, 2012

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!

0 votes
Bob Swift OSS (Bob Swift Atlassian Apps)
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.
June 11, 2012

You are taking about remote APIs. No, not directly. But you can use getSpacePermissionList from Confluence Command Line Interface or use a similar technique.

0 votes
Bob Swift OSS (Bob Swift Atlassian Apps)
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.
June 11, 2012

You are taking about remote APIs. No, not directly. But you can use getSpacePermissionList from Confluence Command Line Interface or use a similar technique.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events