Add role interface for standard role and member role types
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
- Go to GraphQL Explorer at http://127.0.0.1:3000/-/graphql-explorer-legacy.
- 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
}
}
}
- Go to the Roles and Permissions page at http://127.0.0.1:3000/admin/application_settings/roles_and_permissions/.
- Click on New Role and fill out the form to create a new role.
- Verify that the default roles and custom roles show in the table in step 3.
Related to #468398
Edited by Daniel Tian