Hello, these last days we have been playing with the bitbucket API to adjust it to our needs. One of them is to know the default permissions granted to a new member.
I noticed that members are added to the default group, so we can achieve that by checking that group permissions.
However, we are not being able to recover which one of the groups of the workspace is the one selected as default. We can see it on the Web though.
Is there any workaround to achieve this? Thank you,
I don't think that it's possible to get via API which group is the default one at the moment, I will double-check with the development team and I'll let you know.
Please keep in mind the following about the default group:
The default group is the group where a user gets added if they are invited to a repo by a non-admin of the workspace. For example:
Even if the default group doesn't have access to any repo, UserB will continue to have access to https://bitbucket.org/my-workspace/my-repo/ as they were granted explicit access to said repo.
You can use the following API endpoint to get all explicit user permissions for a given repository:
Or the following API endpoint to get the explicit user permission for a given user and repository:
The following API endpoints will return explicit group permissions for a given repository, and explicit group permission for a given group slug and repository respectively:
If you have any questions, please feel free to let me know.
Kind regards,
Theodora
Hey @Theodora, I'm very grateful for getting your response, very clarificating. We were hopping to be able to recover the default goup though, so now we'll try to handle it in a different manner.
If you get an update on this from your Dev team I'll happy to know about.
Thanks again,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I had an update from the development team and I'm afraid that there is no API endpoint that provides a workspace's default group at the moment.
I went ahead and created a feature request about this in our issue tracker:
Please make sure to vote (by selecting the Vote for this issue link) and comment on it to give it more weight and further express your interest. You can also add yourself as a watcher (by selecting the Start watching this issue link) if you'd like to get notified via email on updates. Implementation of features is done as per our policy here and any updates will be posted in the feature request.
In the meantime, we have an internal API endpoint that you can use to retrieve the default group:
https://bitbucket.org/api/internal/workspaces/<workspace-slug>/default-group
Example:
curl -u BB_Username:App_Passowrd -X GET https://bitbucket.org/api/internal/workspaces/<workspace-slug>/default-group
The App_Passowrd needs to have at least Account: Write permissions to access that.
Please keep in mind though that since this is an internal API endpoint, we don't guarantee its behavior.
If you have any questions, please feel free to let me know.
Kind regards,
Theodora
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey @Theodora. Just voted the issue!
We will try your workaround ASAP.
We really appreciated your support, thanks again.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You are very welcome @José Antonio Garcel Díaz, I'm glad to have helped!
Please feel free to reach out if you ever need anything else!
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.