You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
Hi,
is there a way to get from bitbucket REST API 2.0 list of all users that have access to the repository?
Basically, the same data that is presented on the web page in "User and group access" in the admin section for the repository.
I have tried something like https://api.bitbucket.org/2.0/repositories/{name}/sample-repo/access but this resource does not exist.
Thank you
Hello Krzysztof,
Using the Bitbucket v2 REST API does offer more endpoints then its v1 counterpart. Using the API to access which users are within a repo is a bit more straight forward now. The best option to see which users are within a repo is to use the /2.0/user/permissions/repositories endpoint. This endpoint will allow you to see all users with their permission level granted to your repositories. This endpoint does allow for additional filtering using the following examples:
q=repository.name="geordi" or q=permission>"read"
sort=repository.name
I hope this proves helpful in your quest to gather all users within a repo.
Regards,
Stephen Sifers
When I try this endpoint, I get the repositories the connected user can access, not the users in a repository (I believe this is consistent with the doc: https://developer.atlassian.com/bitbucket/api/2/reference/resource/user/permissions/repositories).
Am I missing something?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Well, this endpoint not return all users have access in specific repositories, do you have another measures?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
For anyone who keeps coming back to this question like I have, the accepted answer is NOT correct. As stated by @[deleted] the accepted answer only returns the caller's permissions, not the permissions of the users that have access to a repository.
To get that information, you need to use either the /2.0/workspaces/{workspace}/permissions/repositories endpoint, which will return all repository permissions within your workspace, or the /2.0/workspaces/{workspace}/permissions/repositories/{repo_slug} endpoint, which will return all the permissions for the specified repository.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
"Permissions returned are effective permissions: the highest level of permission the user has. "
Why can't we retrieve the actual permissions on a repository like they are listed on the "User and group access" page? Now, I somehow have to use a deprecated 1.0 API to get groups and their users. Then use this endpoint to get effective permissions, and then use an unreliable diff to figure out direct permissions.
I would like to see a simple endpoint that just returns repository permissions like shown on the configuration page: groups and users.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.