The project creator must not be added as direct member if member lock is activated on the group

Summary

We manage the access at the group level using the group sharing. So we activated:

Permissions
Prevent sharing a project within microservices with other groups

and

Member lock
Prevent adding new members to project membership within this group

But when we create a repository in the group, the creator is added as direct member of the repository while we don't want any user to be direct member of the repositories!

As we check to prevent adding members to the project in this group and to respect this "contract", the creator must not be added as direct member.

Steps to reproduce

Create a group, go to settings, check "Prevent adding new members to project membership within this group" Then create a project in this group, you are now direct member of the newly created project.

What is the current bug behavior?

The creator is added as direct member of the created project

What is the expected correct behavior?

The creator must not be added as direct member of the created project

Edited by 🤖 GitLab Bot 🤖