Unable to remove owner
Use Case
I have the following structure with permissions:
- group [owner: user1]
- subgroup [owner: user1, user2]
- project [owner: user1, user2]
- subgroup [owner: user1, user2]
I want to remove user2 of both the subgroup and project.
I don't have any way to do so.
Members view of subgroup for user1:
Members view of project for user1:
Members view of subgroup for user2:
Members view of project for user2:
I would expect that user2 can be removed by any way (either by user2 removing himself or by user1 removing user2 and in any order subgroup -> project / project -> subgroup).
There are two similar issues but they are different:
- https://gitlab.com/gitlab-org/gitlab-ce/issues/34975 => It was a User error, problem could be resolved
- https://gitlab.com/gitlab-org/gitlab-ce/issues/33129 => Discussion about remove order
For this issue both don't matter. I'm generally unable to remove user2 from project and subgroup.
Do I miss something?
Workaround
- Explicitly assign a new Owner. See #24047 (comment 215213338).
Proposal
- If only one owner is left at the the project/subgroup/group - Show the remove button greyed out and display the tooltip on hover
Text should be:
- For groups:
A group must have at least one owner. To remove the member, assign a new owner.
- For projects:
A project must have at least one owner. To remove the member, assign a new owner.
A future iteration can be to enable the "Remove member" button but open a model to assign a new owner - this would both remove the member (previous owner) and assign a new one in one action
Availability and Testing
- No new E2E test or updates needed at this time. Please add the appropriate coverage for the new tooltip in unit and integration tests.
- Test cases to consider:
- Verify the tooltip displays when a group has only one owner
- Verify the tooltip displays when a project has only one owner
- Verify the tooltip does not display when a group has multiple owners
- Verify the tooltip does not display when a project has multiple owners
- Verify the tooltip does display when a group has multiple owners and they get removed one by one until only one owner is left - that is when the tooltip should appear for the remaining owner
- Ensure to test these scenarios with direct, inherited and shared owners