Skip to content

Display banned group members

Eugie Limpin requested to merge banned_users_table into master

What does this MR do and why?

This MR implements a first iteration of https://gitlab.com/gitlab-org/modelops/anti-abuse/team-tasks/-/issues/42.

It adds a table containing banned members of the group on the group's members page.

For the next iteration (a separate MR), the unban action will be added to each row of banned members in the table.

Screenshots or screen recordings

Screen_Shot_2022-07-13_at_2.45.48_PM

How to set up and validate locally

Set up

  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

Validate

  1. Create a top-level group and invite another member as a non-owner to the group
  2. Ban the invited user in (1) by running the following in Rails console:
    > group = Group.last # the group you created in (1)
    > user = User.last # the user you invited to your group in (1)
    > Users::Abuse::NamespaceBans::CreateService.new(namespace: group, user: user).execute
  3. Using the group owner user go to the group's members page
  4. Validate that you can see Banned tab and the banned user is in the table

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

Loading