Skip to content

Add Ban/Unban actions to user administration dropdown in the admin area

📖 What does this MR do?

Adds a Ban and Unban action to the user administration dropdown in Admin -> Users.

This is in preparation for #332846 (closed) where we will be moving the user administration actions that are currently in cards to a dropdown.

Currently the Ban and Unban actions are behind the ban_user_feature_flag feature flag which is defaulted to off. At this time banning a user only blocks the user but in the future it will remove all comments, issues, MRs, etc.

💻 Local testing

  1. Enable the ban_user_feature_flag.
    • bin/rails console
    • Feature.enable(:ban_user_feature_flag)
  2. Click Menu (in top nav) -> Admin -> Users
  3. Click the dropdown with a cog icon in a user row

📷 Screenshots

View Before After
Unbanned user Screen_Shot_2021-06-24_at_9.12.05_AM Screen_Shot_2021-06-24_at_9.05.53_AM
Banned user Screen_Shot_2021-06-24_at_9.12.21_AM Screen_Shot_2021-06-24_at_9.06.15_AM
Ban user modal N/A ______________________________________________________________ Screen_Shot_2021-06-30_at_8.03.48_AM
Unban user modal N/A ____________________________________________________________ Screen_Shot_2021-06-24_at_9.10.19_AM

🚦 Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

Does this MR contain changes to processing or storing of credentials or tokens, authorization and authentication methods or other items described in the security review guidelines? If not, then delete this Security section.

  • [-] Label as security and @ mention @gitlab-com/gl-security/appsec
  • [-] The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • [-] Security reports checked/validated by a reviewer from the AppSec team
Edited by Peter Hegman

Merge request reports

Loading