Custom roles based on Developer are unable to be selected in merge request approval policies
Summary
When creating a custom merge request security policy for a role, you are not able to select custom roles based on the Developer role (which have access to approve merge requests inherited from developer role) however you are able to select a custom role based on a role lower than Developer with the Can approve merge requests permission checked manually. Both custom roles have the Can approve merge requests permission, however the role based on Developer is not shown in the UI.
A GitLab Ultimate customer reported this behaviour via a ticket
Steps to reproduce
- Create a custom role based on Developer (add any additional permission)
- Create another custom role based on Reporter with
Can approve merge requestspermission - Create a new security policy on a project (any merge request on any protected branch)
- Select
Require X approvalandRoles - In the role dropdown, notice that the custom role based on
Developeris not visible, but the custom role based onReporterwith theCan approve merge requestsis visible
Example Project
N/A - See example screenshots:
Merge Request Policy Editor
Custom Roles of Namespace
Reporter Plus Permissions
Developer Plus Permissions
What is the current bug behavior?
Custom roles based on the Developer role that inherit the Can approve merge requests permission are unable to be selected in Merge Request Policies, whilst custom roles based on a role below Developer such as Reporter but has the Can approve merge requests permission manually selected show as expected.
What is the expected correct behavior?
Custom roles based on Developer should show in the policy editor UI as per the documentation:
You can also specify custom roles (or custom role identifiers in YAML mode) as role_approvers if the custom roles have the permission to approve merge requests. The custom roles can be selected along with user and group approvers.
Output of checks
This bug happens on GitLab.com
Results of GitLab environment info
Expand for output related to GitLab environment info
(For installations with omnibus-gitlab package run and paste the output of: `sudo gitlab-rake gitlab:env:info`) (For installations from source run and paste the output of: `sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production`)
Results of GitLab application Check
Expand for output related to the GitLab application check
(For installations with omnibus-gitlab package run and paste the output of:
sudo gitlab-rake gitlab:check SANITIZE=true)(For installations from source run and paste the output of:
sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true)(we will only investigate if the tests are passing)



