In Bitbucket, how can you tell which groups are in use?

We are using groups in active directory for access control on some repo's.  How can we show which groups are being used by which repo's?

We are changing our active directory configuration, and we'd like to change the access control so that we don't lose it when the old groups disappear.

3 answers

I haven't seen anything like this as a complete solution.

What I would try is using Bitbucket-REST API (https://developer.atlassian.com/static/rest/bitbucket-server/4.5.2/bitbucket-rest.html)

A solution might be: /rest/api/1.0/admin/permissions/groups (haven't used this API yet ...)

Another solution might be:

  1. Get a list of all Bitbucket Projekts   (/rest/api/1.0/projects)
  2. Iterate over all projects and
    - get all Group-permissions for each project (/rest/api/1.0/projects/{projectKey}/permissions/groups)
    - get all Repositories for each project (/rest/api/1.0/projects/{projectKey}/repos)
      - Iterate over all repositories and 
        - get all Group-permissions for each repository (/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/permissions/groups)
        - get all Branches for each repository (/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/branches)
           - Iterate over all Branches and
                - get all Group-permissions for each branch (Hmmmm ... is this possible via API -haven't found it immediately...)

This requires a little scripting but should give you all you need
   

SQL is much easier for me personally.  Would love to have a way to pull this from the back-end mysql database.... if it's there.

As I've written a REST-Client Framework for Bitbucket for internal use, i prefer using the API wink

Suggest an answer

Log in or Join to answer
Community showcase
Piotr Plewa
Published Dec 27, 2017 in Bitbucket

Recipe: Deploying AWS Lambda functions with Bitbucket Pipelines

Bitbucket Pipelines helps me manage and automate a number of serverless deployments to AWS Lambda and this is how I do it. I'm building Node.js Lambda functions using node-lambda&nbsp...

709 views 0 4
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot