Update UserMemberRolesInProjectsPreloader to include custom abilities granted through project sharing
What does this MR do and why?
This MR updates UserMemberRolesInProjectsPreloader to return a user's custom permissions granted to them in shared projects when assign_custom_roles_to_project_links_saas is enabled.
Database changes
Preloaders::UserMemberRolesInProjectsPreloader.new(projects: ..., user: ...).execute
New query
EXPLAIN: https://console.postgres.ai/shared/66d5f50c-7370-4809-a768-97b27b1c8980
Old query
EXPLAIN: https://console.postgres.ai/shared/fb6085a0-c187-4ee9-b683-623bbd5ee50d
References
Implements Update UserMemberRolesInProjectsPreloader to in... (#573286) as part of Assign custom role when sharing a project to a ... (#468329).
Screenshots or screen recordings
Click to expand
1. Screen_Recording_2025-10-10_at_4.32.05_PM 2. Screen_Recording_2025-10-13_at_1.41.57_PM 3. Screen_Recording_2025-10-13_at_1.43.30_PMHow to set up and validate locally
-
Start GDK in SaaS mode:
GITLAB_SIMULATE_SAAS=1 gdk start -
Enable
use_user_group_member_roles,cache_user_project_member_roles, andassign_custom_roles_to_project_links_saasfeature flags -
Login with
root, go to a group the user owns (e.g.gitlab-org), and create a custom role withGuest + Delete projectcustom roleClick to expand
Screen_Recording_2025-10-10_at_4.32.05_PM -
Create a project under the same group then invite another group (
flightjs) and assign them the custom role -
Go to the invited group (
flightjs) then add any user with aDeveloperroleClick to expand
Screen_Recording_2025-10-13_at_1.41.57_PM -
Logout
rootthen login with the user added to the invited group -
Go to the project and confirm that the user can see delete project feature in the project settings page
Click to expand
Screen_Recording_2025-10-13_at_1.43.30_PM
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.