Skip to content

Use GraphQL to fetch available permissions instead of hard-coded

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
ksnip_20231030-233645 ksnip_20231030-233937

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

  1. Go to any group -> Settings -> Roles and Permissions.
  2. Click on Add new role. Verify that there are 6 permissions shown instead of 3.
  3. Check all the permissions and create a new custom role. Verify that the table shows all 6 permissions as badges.
  4. Enable the manage_project_access_tokens feature flag. Repeat steps 2-3, but this time it should show 7 permissions instead of 6.
  5. 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.

Related to #425535 (closed)

Edited by Daniel Tian

Merge request reports

Loading