Use GraphQL to fetch available permissions instead of hard-coded
requested to merge 425535-use-graphql-for-permissions-data into 425535-refactor-role-and-permissions-components
What does this MR do and why?
On the Roles and Permissions page, there are permissions that are either shown in a table in a badge, or as checkbox items when creating a custom role:
Table badges | Checkbox items |
---|---|
Previously, these were hard-coded in the app. This MR changes it to fetch the permissions using GraphQL.
How to set up and validate locally
- Go to any group ->
Settings
->Roles and Permissions
. - Click on
Add new role
. Verify that there are 6 permissions shown instead of 3. - Check all the permissions and create a new custom role. Verify that the table shows all 6 permissions as badges.
- Enable the
manage_project_access_tokens
feature flag. Repeat steps 2-3, but this time it should show 7 permissions instead of 6. - Go to admin ->
Settings
->Roles and Permission
. Repeat steps 2-4.
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 #425535 (closed)
Edited by Daniel Tian