Getting space permissions

Michal Hudak October 24, 2024

Hello,

I have several questions:

1. Endpoint "Get space permissions" (https://developer.atlassian.com/cloud/confluence/rest/v2/api-group-space-permissions/#api-spaces-id-permissions-get) can return a "read" operation (?permission?). Is this the same permission as "view" permission I can see in "Space permissions" section? (here: https://<appname>.atlassian.net/wiki/spaces/<spacekey>/settings/permissions/users - because some of that names do not match.

 

(edit: one user has "view" permission, but API does not return "read" "operation" for him).
(Edit 2: i tried again and it somehow worked)

 

2. When I set permissions individually in "Add people to spaces" section, it says that it can't be undone. But after I saving settings, I can change them in the same section, or in the "Space permissions" section. (https://<appname>.atlassian.net/wiki/admin/permissions/bulk-permissions

 

3. How long does it take for the changes to take effect? I made the changes in permissions an hour ago, but the API still returns the old values. Other endpoints work fine and fast.

 

4. ALso, at the bottom of response is "_links" object with some "next" key. When I use that link I can see other user's permissions for that page. (Why?)

____

In other words: I just want to get all users or groups that have persmission to "view" (or read?) the space.

 

Thanks for your reponses.

1 answer

0 votes
Dhanush
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 24, 2024

Hi @Michal Hudak , your questions have been addressed in the support ticket. 


Re-sharing here for visibility:

  • The "read" operation returned by the "Get space permissions" endpoint is indeed equivalent to the "view" permission you see in the "Space permissions" section. The API uses the term "read" while the user interface uses the term "view", but they refer to the same permission. The issue you experienced with a user having "view" permission but the API not returning the "read" operation for them might have been a temporary glitch; as you mentioned, it worked when you tried again.
  • The warning that changes can't be undone when setting permissions individually in the "Add people to spaces" section is a bit misleading. It's true that once you save the settings, the previous state can't be automatically restored. However, after saving, you can manually change the permissions again in the same section or in the "Space permissions" section.
  • The time it takes for changes in permissions to take effect and be reflected in the API can vary. It should generally be quick, but it can sometimes take longer due to network latency. If you're still seeing old values after an hour, it might be worth checking again after some time or trying to refresh the data.
  • The "_links" object at the bottom of the response includes a "next" key that links to the next page of results. This is part of the API's pagination feature, allowing you to retrieve large data sets in manageable chunks. If you see other users' permissions when you use that link, it's because those permissions are also part of the data set being returned by the API.

To get all users or groups that have permission to "view" (or "read") the space, you can use the "Get space permissions" endpoint and look for permissions with the "read" operation. If you have many permissions, you may need to follow the "next" links to retrieve all the results pages OR use the "limit" in the query parameter and allow it to a maximum of 250.

Michal Hudak October 25, 2024

Thank you, this really helped

Like Dhanush likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events