Is there a way to prevent users to add any developer to their fork? Edited

We use LDAP for authentication and use a separate LDAP group for each repository access. 

For example there is repoA repository and  "repo_a" LDAP group. If a user belongs to that group then he can access repoA.

Assume that user X belongs to repo_a and user Y don't. If user X fork repoA (we want to work with forking workflow), then he can add user Y to his fork. Since his fork also is repoA, we don't want user Y to access repoA because user Y is not in repo_a group.

Is there a way to prevent users to add any developer to their fork? 

1 answer

0 votes

Hi Serdar, there's no way to restrict that. Once you allow someone to fork a repo, this is a new repository and they control who they can invite. He can decide to inherit the permissions from the original repo, but there is no way to enforce that. 

You can disable the forking option, though, if you don't want your developers to create forks at all. 

Hope that helps!


Hi Ana,

Thanks for the answer. Yes we learned as you say from Atlassian support. They also suggested a solution:

Pertaining your question as to whether you can setup Forking permissions in a way that would enforce only users under a certain LDAP group to have access to forked repositories we can confirm that it is not possible.Forked repositories behave as separate repositories, with their own permissions setup.
What you can do instead is delegate Bitbucket Admins that would have permissions to setup the Repositotires and their Forks, enforcing whichever permission sets you require, however that would strip away permissions to the other users for forking, leaving them with access to work on the repositories and forks.

The solution did not seem very useful to us. Then we decided to allow users to fork repos, but in the mean time we implemented an auditing mechanism. We watch Bitbucket audit logs and report conflicts with LDAP rules. 

Glad that you found a way to make it work, and thanks for sharing with the Community!

Have a good day :)


Suggest an answer

Log in or Sign up to answer
Community showcase
Published Nov 06, 2018 in Bitbucket

Upgrade Best Practices

Hello! My name is Mark Askew and I am a Premier Support Engineer for products Bitbucket Server/Data Center, Fisheye & Crucible. Today, I want to bring the discussion that Jennifer, Matt, and ...

695 views 5 9
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