How to set this permission - No permission for * but allow bugfix/*?
Asked by Pankaj Jangid:

I have branching model enabled. Let me know how to set this permission scheme:

I do not want anyone accept "administrator" group to create branches without prefixes like - "feature/", "bugfix/", "hotfix/".

I tried to set this:

- No one listed in \*

- Allow write permission to everyone to write on "bugfix/\*"

But this setting doesn't allow anyone to write to "bugfix/\*".


Answers:
author: Ben
body: Hey Pankaj!

The reason your branch permissions are failing is that setting "\*" will trump all other settings, essentially "\*" means no one can write to ANY branch as this wildcard operator will select everything.  
You will need to define "bugfix/\*" branch name and only add administrators with write permissions, this will mean that any branch that has "bugfix/" prefix will have these permissions applied and will only allow administrators to create these.

More information can be found here:

<https://confluence.atlassian.com/bitbucketserver/branch-permission-patterns-776639814.html>

Hope this helps.

- Ben (Bitbucket Cloud Support)

comments: author: Pankaj Jangid
body: May be that I was not clear. Rephrasing.

Only "Administrator" should be able to create branches **without** prefixes like - "feature/", "bugfix/", "hotfix/". Other people should be allowed branches with the mentioned prefixes.

How can I configure this?


author: Ben
body: Hey Pankaj,

I've just tested on my end what you want to achieve and I believe I have a solution:

* **Create a branch match pattern "\*"**: Assign the admin group to this pattern
* **Create branch match patterns "bugfix/\*, hotfix/\* etc":**Assign the non-admin group to this pattern

Essentially what this will achieve, is that **admins** will be able to create any branch as they are explicitly identified to be able to do so with the **"\*" pattern,** this pattern matches any text whatsoever.  
**Non-admins** are not present on the**"\*" pattern**, they can only create branches where they are explicitly defined, hence they can only create "bugfix, hotfix etc" as you have defined these.

Please create these branch permissions and test with a user, I have attached a screenshot below to show you what I mean.

![screenshot.png](https://community.atlassian.com/t5/image/serverpage/image-id/185102i8BA33E9B1748EDBD/image-size/large?v=v2&px=999 "screenshot.png")

<br />

Cheers!

- Ben (Bitbucket Cloud Support)


author: Pankaj Jangid
body: What I did was something similar. But team members could not push to bugfix and feature branches using my settings. My settings were:

![Screenshot from 2022-03-10 11-15-43.png](https://community.atlassian.com/t5/image/serverpage/image-id/187388i77214B754EEC4EA6/image-size/large?v=v2&px=999 "Screenshot from 2022-03-10 11-15-43.png")![Screenshot from 2022-03-10 11-20-49.png](https://community.atlassian.com/t5/image/serverpage/image-id/187389iE3DEA7F136287BCB/image-size/large?v=v2&px=999 "Screenshot from 2022-03-10 11-20-49.png")


author: Ben
body: Hey Pankaj,

Yes, this is because the "\*" search pattern will match all branch names and will take precedence over every other branch restriction that you define (as indicated by the yellow "!" icon next to the restriction names indicating a conflict).  
Therefore as soon as Bitbucket Cloud sees that NO ONE is able to write to any branches (indicated by "\*" search pattern), all the other restrictions you have defined are canceled out, and no one is able to write to any branches.  
Did you manage to try out the configuration I had suggested?

Cheers

- Ben (Bitbucket Cloud)


author: Pankaj Jangid
body: Nope. Just tried to assign "Administrator" to "\*" pattern. And this is still overriding the permission settings for other patterns.

![Screenshot from 2022-03-14 12-16-09.png](https://community.atlassian.com/t5/image/serverpage/image-id/187938i98A51316E018687A/image-size/large?v=v2&px=999 "Screenshot from 2022-03-14 12-16-09.png")


author: Ben
body: Hey Pankaj,

By defining "Everybody" in those other pattern types this also includes "Administrators" and creates another conflict. Are you able to define a single person in Write access for one of those branch patterns, then attempt to have them push to see if it works? The idea is that Administrator group is defined explicitly to be able to create any branch they desire, then individual user groups ie Developers are allowed write access to other pattern types (for example as shown in the screenshot which I have provided, where I have tested this and it has worked).

If this still does not work, please let me know.

Cheers!

-Ben (Bitbucket Cloud Support)


author: Pankaj Jangid
body: [@Ben](/t5/user/viewprofilepage/user-id/4537226) This worked. Thanks a lot. I created a non-admin group and assigned that with write permission on prefixed patterns. And this worked.


Tags: bitbucket-cloud

cloud

permission