Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,467,302
Community Members
 
Community Events
177
Community Groups

Bulk update to permissions and repos

Deleted user Mar 22, 2022

Hello all,

I am racing towards a deadline and urgently need to automate the following, Any help will be greatly appreciated.

  1. Extract all permissions on all repos
  1. Figure out a script or a way to bulk modify the permissions on specific repos

  2. Figure out a script or a way to bulk add users to groups and modify repos to grant permission to users within these groups.

  3. Figure out a script or a way to bulk delete users from a group.

 

I will be thankful if anyone can provide info on how to do this for BitBucket.

Thanks

Junaid

1 answer

0 votes

Hi Junaid,

I see that you have created a support ticket for this issue and your questions have been answered there. I'll leave a reply here as well for any other users who may come across your post with the same questions.

Please allow me to give some context first, there are two ways for a user to gain/have access to a repo:

  1. they can be granted direct access from Repository settings > User and group access > Add members
  2. they can have access via a user group, i.e. be invited to a user group that has access to the repo

Regarding your questions:

Extract all permissions on all repos

You can use the following endpoint:

Please note the following:

Permissions returned are effective permissions: the highest level of permission the user has. This does not distinguish between direct and indirect (group) privileges.

 

Figure out a script or a way to bulk modify the permissions on specific repos

If a user has direct access to a repo, it is not possible to modify their permissions via API, this needs to be done via the UI.

It is possible to modify the permissions of a certain user group via API using the following endpoint:

 

Figure out a script or a way to bulk add users to groups

You can invite a user to a user group with the following endpoint:

 

modify repos to grant permission to users within these groups.

If the user group already has access to a certain repo, you don't need to take any action. However, if the user group doesn't have access to a repo, you can use the following endpoint to add the user group to a repo:

Figure out a script or a way to bulk delete users from a group.

You can use the following endpoint:

Please note that if a user has direct repo access, in addition to access via a user group, it is not possible to revoke that direct access via API.

We have a feature request about this in our issue tracker: https://jira.atlassian.com/browse/BCLOUD-19896

Kind regards,
Theodora

Deleted user Mar 30, 2022

Hi Theodora,

 

Thank you very much for the detailed response. We were able to automate a lot of user management through your guidance as well as through the Atlassian support.

 

Have a great day.

 

Junaid

Like Theodora Boudale likes this

Hi Junaid,

That's good to hear and you are very welcome.

Please feel free to reach out if you ever need anything else!

Kind regards,
Theodora

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events