Draft: Resolve "Query to denormalize user membership access levels"
What does this MR do and why?
User group membership access levels are stored in a normalized form in the members
table. This MR will provide an ability to query group membership access_level
in a denormalized form.
An example scenario where we have groups A B C D E F G
. Carla has two direct memberships, and Alex has one.
graph TD
A --> B
A --> C
B --> D
B --> E
C --> F
C --> G
caral1[Carla]-. reporter .-A
Carla-. developer .-E
Alex-. developer .-D
The members
table records look like so:
User | Group | Access Level |
---|---|---|
Alex | D | Developer |
Carla | A | Reporter |
Carla | B | |
Carla | C | |
Carla | D | |
Carla | E | Developer |
Carla | F | |
Carla | G |
However, due to inheritance, Carla and Alex also have membership in descendant groups which do not contain membership records. We want to query the access level for all rows to generate a table like so:
User | Group | Access Level |
---|---|---|
Alex | D | Developer |
Carla | A | Reporter |
Carla | B | Reporter |
Carla | C | Reporter |
Carla | D | Reporter |
Carla | E | Developer |
Carla | F | Reporter |
Carla | G | Reporter |
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #374046 (closed)