How do I manage users on Bitbucket
Asked Answered
S

3

7

I have been reading the bitbucket documentation and I am still confused about how to manage users well on my repo.

I want to give some developers the ability to pull and push to certain branches but not others, i.e. they can pull and push to a developer-master branch, but the final merges to the live master branch is something that only an admin can do.

In addition to this, I would love for this to require their own individual passwords, but not a password that gives them access to the entire repository. Right now a push requires only one password for the entire repository, which also gives them admin access to the entire bitbucket repository.

I did read the documentation but am still unclear on how to do this effectively. Help! :)

Sapindaceous answered 31/7, 2013 at 6:58 Comment(3)
I don't understand the last part of your question. Bitbucket allows to set read write and admin rights to individual users to a repository. Write = push, it doesn't imply admin.Agential
atlassian.com/software/stash/overview has per-branch permissionsAntilogarithm
how do I set a password for this individual user?Sapindaceous
C
3

Go to settings of the repo and choose 'Branch Management'.

Here you can give write access to specific branches to any users or groups you want. All of the rest branches will have write access from all of the users and groups (who have write access in general).

Take the example of my repo named bqotd.

I have four branches in this repo: htmls, design, docs and master. I wanted to limit write access of our front-end developer to htmls branch only so I had to do this:

bitbucket screenshot

I had to give write access to everyday except FED to all of the branches other than htmls branch.

Cason answered 23/9, 2014 at 13:6 Comment(0)
M
1

Original answer (July 2013)

I don't think you can assign permissions for branches of a repository (see below).
There is a pending ticket on that (issue 5554).

That mean I would rather clone that repo on the server (a "fork"), in order for the developers to push to any branch they want, and for an integrator to pull from that dev repo and update the master branch of the live repo.


Update post Sept 2013:

The ticket mentioned above has been resolved (see comment-5845513)

We've released branch restrictions which can be configured via the repository admin "Branch management" screen.

See BitBuket Branch management

To prevent any user from pushing to a branch, you can, do this:

  1. Create a group called EmptyGroup on your account.
    You can name the group anything you like. We recommend you choose a name that reflects how the group is used.
  2. Give the group write permissions.
  3. Go to the Branch Management page.
  4. Locate the Limit pushes to specific users and groups section.
  5. Limit pushes to a branch to the EmptyGroup group.

Any user not part of the group would not be able to push to that branch.

Mendelian answered 31/7, 2013 at 8:34 Comment(2)
Is it possible to give this forked repository a separate password for an individual user?Sapindaceous
@NicholasFinch No, I would rather use a separate public/private ssh key. The password is the BitBucket user's account, and it remains unique as long as the user is a member of a repo (forked or not). But the user can register a different public ssh key if he/she wants.Mendelian
O
0

Additionally, there is a chance that you do not have admin access. In that case, you won't have Setting displayed in your left panel. So, before moving ahead do verify that you have admin access to the repo.

Octosyllabic answered 30/10, 2023 at 10:25 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.