Skip to content

Owners can unban banned subgroup members

Eugie Limpin requested to merge el-unban-banned-subgroup-members into master

This MR depends on !101029 (merged).

Resolves https://gitlab.com/gitlab-org/modelops/anti-abuse/team-tasks/-/issues/112.

What does this MR do and why?

Currently, only top-level group members are displayed in a top-level group's banned members table. This is a problem because members of subgroups can also be banned from the top-level group but owners can only manage banned members from the top-level group members page.

This MR updates the banned members table to also display and be able to unban subgroup members.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

How to set up and validate locally

  1. Ensure you are running GDK with an Ultimate license. The following command should log true if this is set up correctly
    echo "License.feature_available?(:unique_project_download_limit)" | rails c
  2. Turn on the feature flags:
    echo "Feature.enable(:limit_unique_project_downloads_per_namespace_user)" | rails c
  3. Create a top-level group and then a subgroup inside the top-level group
  4. Add another user to the subgroup
  5. Ban the subgroup member you just added via Rails console
    > subgroup = Group.last # assuming the subgroup you created in step 3 is the most recent group created
    > subgroup_member = subgroup.group_members.last # this should be the user you added to the subgroup. Not the owner of the top-level group
    > group = subgroup.parent
    > ::Namespaces::NamespaceBan.create(user: subgroup_member.user, namespace: group)
  6. Validate that the user added to the subgroup is displayed in the group's banned members table
  7. Click on Unban button
  8. Validate that the user added to the subgroup is unbanned

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Eugie Limpin

Merge request reports