Fix missing groups in User#authorized_groups
What does this MR do and why?
This fixes two cases where groups were missing from the user's authorized groups:
-
Ancestors of projects the user has access to
Right now, we only consider the direct parent but we actually grant access to all ancestor groups of the project.
-
Descendants of groups the user has access via shares
Right now, we only include the group being shared but the user also has access to all descendants of the shared group.
Queries
- Old: https://postgres.ai/console/gitlab/gitlab-production-main/sessions/31958/commands/99036
- New: https://postgres.ai/console/gitlab/gitlab-production-main/sessions/31958/commands/99046
Note that I changed the SELECT to "namespaces".*
instead of listing every column of the table to improve readability
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
How to set up and validate locally
See #482866 (closed)
Related to #482866 (closed)
Edited by Heinrich Lee Yu