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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

REST API call to get Confluence space permissions?

Philip Colmer
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.
Sep 06, 2019

I think the answer to this is no, but is there a REST API call I can make to retrieve the top-level space permissions for a given space?

I've been asked to tighten up our exit procedure so that spaces aren't left dying because there is nobody with admin access on a space after people leave.

Thanks.

 

3 answers

1 vote
Bert van Dijk _TMC_nl_
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.
Sep 12, 2023 • edited
This is an old thread, but what about the following Python script:
NOTE: it doesn't give you detailed information
import requests
import json
from atlassian import Confluence
 
# Change the following:
confluence_url = 'https://xxx.atlassian.net/'
username = 'user@company.com'
password = 'API token'
#########################
confluence = Confluence(url=confluence_url,username=username,password=password,cloud=True)
spaces = confluence.get_all_spaces(start=0, limit=500, expand=None)
for space in spaces["results"]:
    url = confluence_url+"/wiki/rest/api/space/"+space["key"]+"?expand=permissions"
    response = requests.get(url, auth=(username, password)).json()
    for permission in response["permissions"]:
        if "user" in permission["subjects"]:
            data = permission["subjects"]["user"]
            name = "publicName"
        else:
            data = permission["subjects"]["group"]
            name = "name"
        results = data["results"]
        for result in results:
            print(space["key"] + " - " +result[name])
1 vote
Diego
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Sep 09, 2019

Hello, @Philip Colmer !
You are right on this matter. The REST API does not support the request you are looking for.
There are, in fact, some threads in our Developer Community about it. There they also proposed solutions to the situation. Take a look:

Let us hear from you, Philip! Looking forward to your reply.

Hey all,

Does anybody happen to know if this is still true as of today? /api/space/SPACE_KEY?expand=permissions works on a Confluence Cloud instance but not on my Confluence Server 7.1

Thanks

Like Ruslan Krivoshein likes this
Deleted user Aug 26, 2020

using 7.3.5, no its still not fixed. 

Apparently you need to write your own java plugin.

Hi Philip,

Did you manage to retrieve the permission groups for a given space?  How did you solve this ?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events