Show custom role details in drawer
What does this MR do and why?
On the Manage
-> Members
page for any group/project, a list of members is shown. In the max role column, when the role name is clicked for a user, the role details will show in a drawer. In a previous MR, we added the base role details to the drawer, which only shows the role name and a link to the permissions doc page.
This MR adds in the custom role details, which shows the role description, the base role, and the enabled permissions for that role:
Members list | Base role drawer | Custom role drawer (what this MR changes) |
---|---|---|
How to set up and validate locally
- Go to
Admin Area
->Settings
->Roles and Permissions
. - Click the
New role
button and create a new custom role. - Go to either a group or project, then go to
Manage
->Members
. - Click the
Invite members
button to bring up the invite modal. Select a standard role, then use the modal to invite a person. - Invite another person, but this time select the custom role you created.
- Enable the
show_role_details_in_drawer
feature flag. Note that after enabling the feature flag, you will be unable to change the role assigned to a user.
echo "Feature.enable(:show_role_details_in_drawer)" | rails c
- In the members list, click on the user with the standard role. Verify that the drawer shows, and only the role name and the permissions link is shown.verify that the role names show up as links, and the user with the custom role has a
Custom role
badge below the role name. - In the members list, click on the user with the custom role. Verify the following:
- Role name is shown with
Custom role
badge to the right of it. - Role description is shown.
- Base role is shown directly underneath permissions header, with the
View permissions
link to the right of it. - The role's enabled permissions are shown with a check icon, the permission name, and the permission description.
- Role name is shown with
Related issue: #456273 (closed)
Edited by Daniel Tian