Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Permission on project level Bitbucket server

Mugurel
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 8, 2018

Hello,

I want to enforce permissions at the project level so that when a DevOps engineer creates the repo by default it's locked up. How I've established the branch permissions at the project level is that for the master branch I'm preventing 'Rewrite history' and 'Deletion' for everyone. 'All changes' is only allowed for our CI/CD user. Now the problem is because of this I can't actually create the master branch itself. How can I get Bitbucket to automatically create the master branch? Or how do I allow access to *just* create the master branch to a certain group and nothing? I don't want to allow a specific group to the list of 'Exemptions'  for 'All changes' and I'd still like to enforce these permissions on a project level. Thanks in advance.

2 answers

1 vote
Kristy
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 23, 2018

Hi @Mugurel,

 

Apologies if you were notified of my previous (incorrect) responses - I misread your question.

 

I think that the problem here is that you want to restrict 'all changes' for the master branch. This setting can be used in a number of different ways. In your case, you'd like the creation of that branch to be allowed but further modifications to be restricted. In other cases, they may want to restrict branches from ever being created in the first place. This setting is for the latter case - restriction all changes, including creation

There are a few options you could look into:

1. Instead of using the 'branch name' setting when creating your branch permission, use the 'branch model' setting. By selecting 'Development Branch' (which defaults to master) you will allow users to push up master because the default branch gets set after the push succeeds.

2. Get your CI tool to create the master branch

3. Allow another user as an 'exception' to the rule so that they can create the master branch

 

Hope one of these options are what you're looking for,

Kristy

0 votes
Julius Davies [bit-booster.com]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 24, 2018

Control Freak for Bitbucket Server is a paid add-on that should work well for your situation.  It lets you define your rules globally (or per-project or per-repo).

You can configure "Control Freak" to only apply its rules against non-empty repos.  This way anyone can create an initial master branch, since the rules won't apply for the very first push.

 

- Sylvie

(We maintain 3 paid add-ons:  Control Freak, Git Graph for JIRA, and Rebase Squash Amend).

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events