atlassian-python-api icon indicating copy to clipboard operation
atlassian-python-api copied to clipboard

API method to check if a user has permission on a specific page/space

Open amitjoy opened this issue 1 year ago • 2 comments

I am currently looking for an API which would return if another user has READ permission on a specific space/page. I stumbled upon /wiki/rest/api/content/{id}/permission/check [1] which I think could be used for my scenario. However, I could not find any API method in the library to verify my assumption though.

[1] - https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-content-permissions/#api-group-content-permissions

amitjoy avatar Apr 11 '24 10:04 amitjoy

hmm it would be indeed a nice addition to the library. From what I see in the docs above endpoint is not listed in v2 version of the API (which should be used now - https://developer.atlassian.com/cloud/confluence/rest/v2/intro/#auth). There is however api endpoint for space permission https://developer.atlassian.com/cloud/confluence/rest/v2/api-group-space-permissions/#api-group-space-permissions.

It is possible that v1 endpoint for wiki/rest/api/content/{id}/permission/check still works, but adding a new library method to v1 is a bit risky from our perspective (it can be deprecated at any point). Let me check with atlassian if they are planning to add contnent permissions endpoints to v2 api.

0x89g09sa823 avatar Apr 12 '24 06:04 0x89g09sa823

@gkowalc Thanks a lot for your quick feedback. The space permission is the new addition in v2 which was missing in v1. That's why, possibly this v1 API endpoint has been removed but to be frank, the new v2 endpoint cannot replace the v1 endpoint since we still cannot figure out if any user has a specific permission (e.g. READ) on a specific space or a page. That's why, it would really be nice to have an endpoint for this purpose.

amitjoy avatar Apr 12 '24 11:04 amitjoy

Added all methods https://github.com/atlassian-api/atlassian-python-api/commit/15b9d6536bb3a6e79ac0a46921ad8068b40ad4c7

for cloud by resource url will work

gonchik avatar Mar 31 '25 08:03 gonchik