Today, there is no way to filter the Member list in a project or group by role. See related customer feedback.
Group members page
Project members page
Proposal
Add a role filter to the Members page to allow seeing all members of a certain role within a group or project.
The query and filter component on explorer page has been established. This should be copied to the members page. Currently, the UI supports only Owner on the dropdown. The members page should support:
Why they are interested: Customer would like to be able to filter the member list in a group or project by role so they can identify the appropriate people to help with various tasks.
@jayswain@ipelaez1 JFYI - this one is a good example of a cascading/dependent permission. If someone doesn't have the ability to manage members, then they wouldn't have the ability to filter the member list.
@ipelaez1 With the filter component developed for the explorer page (see screenshot in description), can this be moved over to workflowrefinement to understand the queries needed to build this filter?
@gitlab-org/govern/authorization I believe this needs refinement on the how to query default roles and custom roles. The default roles (access_level) query (0-50) seems to work on the explore page but suspect it would need to be copied to the members page. cc @jayswain
If you do not feel the purpose of this issue matches one of the types, you may apply the typeignore label to exclude it from type tracking metrics and future prompts.
Add new token in filteredSearchBar token in app/assets/javascripts/pages/groups/group_members/index.js and app/assets/javascripts/pages/projects/project_members/index.js
Create token constant and add it to AVAILABLE_FILTERED_SEARCH_TOKENS constant in ee/app/assets/javascripts/members/constants.js
Populate token options with parsed roles from injected element data in app/assets/javascripts/members/components/filter_sort/members_filtered_search_bar.vue
Backend
Add roles to group_members_app_data and project_members_app_data methods in options format. Make use of MemberRoles::RolesFinder for finding custom roles and of ProjectMember.access_level_roles or GroupMember.access_level_roles for static roles.
Declare new filter token type as permitted in filter_params methods for EE::Groups::GroupMembersController and EE::Projects::ProjectMembersController
Create EE version of MembersFinder
Parse role from params (find way to distinguish static vs custom roles) and add filtering by given role in EE::GroupMembersFinder and EE::MembersFinder
Questions
Should we add (static) role filtering for non-EE as part of this issue?
Should we allow filtering by role with the >, <, >= and <= operators instead of just the = operator (particularly useful for filtering by static roles, but might be cause for concern when filtering by custom roles)?
MR's
We could split this issue up into distinct MR's:
add static role filtering for groups (if we want to add non-EE filtering support)
add static role filtering for projects (if we want to add non-EE filtering support)
add custom role filtering for groups
add custom role filtering for projects
add support for other operators (if we want to support that)
Thanks for breaking this down, Alex. Feel free to promote to epic and create sub-issues, create tasks, or leave as is and link all MRs to a single issue.
Scope reduction opportunities: Yes, as outlined here, but decided to do it in 1 MR anyway, since the proposed sub-features are tightly coupled and the resulting MR is not too large, imo.