[go: up one dir, main page]

Skip to content

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_PM

How to set up and validate locally

  1. Start GDK in SaaS mode: GITLAB_SIMULATE_SAAS=1 gdk start

  2. Enable use_user_group_member_roles, cache_user_project_member_roles, and assign_custom_roles_to_project_links_saas feature flags

  3. Login with root, go to a group the user owns (e.g. gitlab-org), and create a custom role with Guest + Delete project custom role

    Click to expand Screen_Recording_2025-10-10_at_4.32.05_PM
  4. Create a project under the same group then invite another group (flightjs) and assign them the custom role

  5. Go to the invited group (flightjs) then add any user with a Developer role

    Click to expand Screen_Recording_2025-10-13_at_1.41.57_PM
  6. Logout root then login with the user added to the invited group

  7. 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.

Edited by Eugie Limpin

Merge request reports

Loading