Fix project creation permissions for users in shared groups
What does this MR do and why?
Fix project creation permissions for users in shared groups
Users were unable to create projects when:
- User belongs to a group with project creation disabled
- A group with project creation enabled is shared with the first group
The shared group's project creation settings should take precedence over the source group's restrictions, allowing users to create projects in the target group regardless of their source group's limitations.
This is resolved by fixing a logical bug on how we derive the user's permission to select a namespace.
Changelog: fixed
References
Related to #411294 (closed)
Screenshots or screen recordings
| Before | After |
|---|---|
|
|
How to set up and validate locally
- Start with a fresh user, without access to any other groups or namespaces
- Create Group
Developers - Configure Group
DeveloperswithRoles allowed to create projects = "No One" - Assign user
Danny Developerto this group with Developer access - Create and configure another group
ProjectswithRoles allowed to create projects = "Developers + Maintainers" - Invite group
DeveloperstoProjectswith Developer access. - Log in as
Danny Developer, and click on the "Create new project" button
Before: The namespace dropdown is disabled. By default it would pre-select the user's namespace.
After: The namespace dropdown is enabled. The user can select either their own namespace or the Projects namespace.
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

