Skip to content

Developer role is able to accept merge requests on protected branch

Summary

As a Developer in a project I'm able to accept merge requests on master branch, which is protected by default. I'm an administrator user, and I previously had Master role for that project. I declassify myself lately because we had too many Masters.

The Protected Branches settings for that project, available at /settings/repository relative URL, are the following:

Protected branch Allowed to merge Allowed to push
master Masters Masters

Steps to reproduce

  1. Create a Merge Request as Developer from a branch towards master
  2. Set it to automatically merge as CI pipeline is successful
  3. The issue is merged

What is the current bug behavior?

A Developer should not be able to auto-accept merge requests towards protected branches, unless explicitly allowed by a Master in the Protected Branch settings.

What is the expected correct behavior?

Only a Master should be able to accept merge request towards protected branches, unless a Master explicitly allows also developer to do so.

Relevant logs and/or screenshots

Project_Members__Filtered_ Protected_Branches Merge_into_master Permissions

Output of checks

Results of GitLab environment info

Expand for output related to GitLab environment info
System information
System:		Debian 8.9
Current User:	git
Using RVM:	no
Ruby Version:	2.3.5p376
Gem Version:	2.6.13
Bundler Version:1.13.7
Rake Version:	12.1.0
Redis Version:	3.2.5
Git Version:	2.13.6
Sidekiq Version:5.0.4
Go Version:	unknown

GitLab information Version: 10.1.4 Revision: c887c03 Directory: /opt/gitlab/embedded/service/gitlab-rails DB Adapter: postgresql URL: https://gitlab.smartlis.com HTTP Clone URL: https://gitlab.smartlis.com/some-group/some-project.git SSH Clone URL: git@gitlab.smartlis.com:some-group/some-project.git Using LDAP: no Using Omniauth: no

GitLab Shell Version: 5.9.3 Repository storage paths:

  • default: /var/opt/gitlab/git-data/repositories Hooks: /opt/gitlab/embedded/service/gitlab-shell/hooks Git: /opt/gitlab/embedded/bin/git

Results of GitLab application Check

Expand for output related to the GitLab application check
Checking GitLab Shell ...

GitLab Shell version >= 5.9.3 ? ... OK (5.9.3) Repo base directory exists? default... yes Repo storage directories are symlinks? default... no Repo paths owned by git:root, or git:git? default... yes Repo paths access is drwxrws---? default... yes hooks directories in repos are links: ... 1/2 ... ok 1/36 ... ok 2/38 ... ok 2/39 ... ok 2/40 ... ok 2/41 ... ok 24/42 ... ok 24/43 ... ok 24/44 ... ok 24/45 ... ok 24/46 ... ok 24/47 ... ok 24/48 ... ok 24/49 ... ok 24/50 ... ok 24/51 ... ok 24/52 ... ok 24/53 ... ok 24/54 ... ok 24/55 ... ok 24/56 ... ok 24/57 ... ok 24/58 ... ok 24/59 ... ok 1/64 ... ok 4/71 ... ok 2/72 ... ok 2/73 ... ok 2/74 ... ok 24/75 ... ok 24/76 ... ok 24/77 ... ok 2/78 ... ok 14/79 ... ok 2/80 ... ok 24/81 ... ok 24/82 ... ok 24/83 ... ok 24/84 ... ok 24/85 ... ok 24/86 ... ok 24/87 ... ok 14/90 ... ok 24/91 ... ok 24/92 ... ok 24/93 ... ok 24/94 ... ok 46/95 ... ok 25/96 ... ok 46/98 ... ok 2/101 ... ok 17/102 ... ok 22/103 ... ok 2/104 ... ok 14/105 ... ok 3/106 ... ok 24/107 ... ok 24/108 ... ok 24/109 ... ok 25/110 ... ok 2/111 ... ok 24/112 ... ok 22/113 ... ok 22/114 ... ok 3/115 ... ok 17/116 ... ok 17/117 ... repository is empty 27/120 ... ok 2/121 ... ok 17/122 ... repository is empty 17/123 ... ok 24/124 ... ok 24/125 ... ok 28/126 ... ok 2/127 ... ok 24/128 ... ok 31/130 ... ok 24/131 ... ok 17/132 ... ok 33/133 ... repository is empty 24/134 ... ok 17/135 ... ok 24/136 ... ok 17/138 ... repository is empty 24/139 ... ok 17/140 ... ok 22/141 ... ok 17/142 ... ok 14/143 ... ok 25/144 ... ok 17/145 ... ok 2/146 ... ok 2/147 ... ok 24/150 ... ok 24/151 ... ok 2/153 ... ok 40/154 ... ok 12/155 ... ok 12/156 ... repository is empty 29/157 ... ok 25/158 ... ok 24/160 ... repository is empty 2/161 ... ok 24/162 ... ok 24/163 ... ok 24/164 ... ok 24/166 ... ok 24/167 ... ok 25/168 ... ok 24/169 ... ok 25/170 ... ok 45/171 ... ok 5/172 ... repository is empty 2/173 ... repository is empty 2/174 ... ok 42/175 ... ok 2/176 ... ok 24/177 ... ok Running /opt/gitlab/embedded/service/gitlab-shell/bin/check Check GitLab API access: OK Redis available via internal API: OK

Access to /var/opt/gitlab/.ssh/authorized_keys: OK gitlab-shell self-check successful

Checking GitLab Shell ... Finished

Checking Sidekiq ...

Running? ... yes Number of Sidekiq processes ... 1

Checking Sidekiq ... Finished

Reply by email is disabled in config/gitlab.yml Checking LDAP ...

LDAP is disabled in config/gitlab.yml

Checking LDAP ... Finished

Checking GitLab ...

Git configured correctly? ... yes Database config exists? ... yes All migrations up? ... yes Database contains orphaned GroupMembers? ... no GitLab config exists? ... yes GitLab config up to date? ... yes Log directory writable? ... yes Tmp directory writable? ... yes Uploads directory exists? ... yes Uploads directory has correct permissions? ... yes Uploads directory tmp has correct permissions? ... yes Init script exists? ... skipped (omnibus-gitlab has no init script) Init script up-to-date? ... skipped (omnibus-gitlab has no init script) Projects have namespace: ... 1/2 ... yes 1/36 ... yes 2/38 ... yes 2/39 ... yes 2/40 ... yes 2/41 ... yes 24/42 ... yes 24/43 ... yes 24/44 ... yes 24/45 ... yes 24/46 ... yes 24/47 ... yes 24/48 ... yes 24/49 ... yes 24/50 ... yes 24/51 ... yes 24/52 ... yes 24/53 ... yes 24/54 ... yes 24/55 ... yes 24/56 ... yes 24/57 ... yes 24/58 ... yes 24/59 ... yes 1/64 ... yes 4/71 ... yes 2/72 ... yes 2/73 ... yes 2/74 ... yes 24/75 ... yes 24/76 ... yes 24/77 ... yes 2/78 ... yes 14/79 ... yes 2/80 ... yes 24/81 ... yes 24/82 ... yes 24/83 ... yes 24/84 ... yes 24/85 ... yes 24/86 ... yes 24/87 ... yes 14/90 ... yes 24/91 ... yes 24/92 ... yes 24/93 ... yes 24/94 ... yes 46/95 ... yes 25/96 ... yes 46/98 ... yes 2/101 ... yes 17/102 ... yes 22/103 ... yes 2/104 ... yes 14/105 ... yes 3/106 ... yes 24/107 ... yes 24/108 ... yes 24/109 ... yes 25/110 ... yes 2/111 ... yes 24/112 ... yes 22/113 ... yes 22/114 ... yes 3/115 ... yes 17/116 ... yes 17/117 ... yes 27/120 ... yes 2/121 ... yes 17/122 ... yes 17/123 ... yes 24/124 ... yes 24/125 ... yes 28/126 ... yes 2/127 ... yes 24/128 ... yes 31/130 ... yes 24/131 ... yes 17/132 ... yes 33/133 ... yes 24/134 ... yes 17/135 ... yes 24/136 ... yes 17/138 ... yes 24/139 ... yes 17/140 ... yes 22/141 ... yes 17/142 ... yes 14/143 ... yes 25/144 ... yes 17/145 ... yes 2/146 ... yes 2/147 ... yes 24/150 ... yes 24/151 ... yes 2/153 ... yes 40/154 ... yes 12/155 ... yes 12/156 ... yes 29/157 ... yes 25/158 ... yes 24/160 ... yes 2/161 ... yes 24/162 ... yes 24/163 ... yes 24/164 ... yes 24/166 ... yes 24/167 ... yes 25/168 ... yes 24/169 ... yes 25/170 ... yes 45/171 ... yes 5/172 ... yes 2/173 ... yes 2/174 ... yes 42/175 ... yes 2/176 ... yes 24/177 ... yes Redis version >= 2.8.0? ... yes Ruby version >= 2.3.3 ? ... yes (2.3.5) Git version >= 2.7.3 ? ... yes (2.13.6) Git user has default SSH configuration? ... yes Active users: ... 20

Checking GitLab ... Finished