Can add an existing group member into a group project with new permissions but permissions are not overridden
Summary
When adding a existing group member into a project with different permissions, the permissions are not overridden.
Steps to reproduce
- In a group add a member Z with
maintainerpermission - In the same group, create a project and add member Z with
guestpermission - Protect the master branch so that only members with
maintainerpermission can push - Ask member z to push to the master branch
Example Project
Tested it on https://gitlab.com/my-super-duper-awesome-group/my-super-duper-awesome-group.gitlab.io
What is the current bug behavior?
Member Z is able to push to the master branch
What is the expected correct behavior?
Since the functionality is to not override member permissions in group projects[1], we shouldn't be able to add existing members with a lower project-specific role if they're inheriting from a parent group.
Since projects inherit roles from their parent group, we shouldn't allow the setting of a "lower" role in a one of these projects. In the scenario in the description, we should present an error in the UI and not allow the member's role to be set below Maintainer.
Edited by Jeremy Watson (ex-GitLab)