Skip to content

Add role interface for standard role and member role types

Daniel Tian requested to merge 468398-add-role-interface into master

What does this MR do and why?

We have a MemberRole and a StandardRole type for GraphQL. The two are closely related and have a bunch of common fields across the two. This MR adds a RoleInterface for the two types and moves the common fields into the interface. This also allow frontend to write fragments on the RoleInterface instead of one of the two types.

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

  1. Go to GraphQL Explorer at http://127.0.0.1:3000/-/graphql-explorer-legacy.
  2. Run this query and verify that it returns data without errors:
Query
query {
  standardRoles {
    nodes {
      name
      membersCount
      usersCount
      detailsPath
    }
  }
  memberRoles {
    nodes {
      name
      membersCount
      usersCount
      detailsPath
    }
  }
}
  1. Go to the Roles and Permissions page at http://127.0.0.1:3000/admin/application_settings/roles_and_permissions/.
  2. Click on New Role and fill out the form to create a new role.
  3. Verify that the default roles and custom roles show in the table in step 3.

Related to #468398

Edited by Daniel Tian

Merge request reports

Loading