Non-root owners cannot assign custom roles
Summary
It has been identified that non-root group or project owners cannot assign custom roles.
Steps to reproduce
Set up user, group, project, and custom role
- As namespace/rootgroup owner, create a custom role named CR1 with developer+admin_vulnerability..
- Add user_A to a root group and assign either Guest/Reporter/Developer/Maintainer (not owner)
- Create subgroup_A
- Add a project_1 to subgroup_A
- Invite user_A to to subgroup_A as Owner
Impersonate userA for subgroup_A
- Within incognito mode, sign in as user_A and go to subgroup_A
- Go to
/-/group_members
of subgroup_A - Click Invite members
- The dropdown should include CR1 on Invite modal.
- The dropdown should include CR1 for "max_role" on members page too.
Impersonate userA for project_1
- Within incognito mode, sign in as user_A and go to project_1
- Go to
/-/project_members
of project_1 - Click Invite members
- The dropdown should include CR1 on Invite modal.
- The dropdown should include CR1 for "max_role" on members page too.
Example Project
What is the current bug behavior?
Custom roles are not showing up in permission dropdowns if you are not the root group owner.
What is the expected correct behavior?
Non-root group owners should see custom roles in the dropdown.
Relevant logs and/or screenshots
Root group permission
subgroup_A permission
Missing custom roles from dropdown
Output of checks
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)
Possible fixes
Edited by Joe Randazzo