Display unban action button when user has the necessary permission
Partially resolves https://gitlab.com/gitlab-org/modelops/anti-abuse/team-tasks/-/issues/112
What does this MR do and why?
This MR fixes a bug wherein the Unban
action button is not displayed when there is only one banned user in the banned group member table despite the current user having permission to unban. The bug exists because the table does not check the current user's canUnban
permission for the member row when trying to hide the table's action column.
Screenshots or screen recordings
Before | After |
---|---|
How to set up and validate locally
- Ensure you are running GDK with an Ultimate license. The following command should log
true
if this is set up correctlyecho "License.feature_available?(:unique_project_download_limit)" | rails c
- Turn on the feature flags:
echo "Feature.enable(:limit_unique_project_downloads_per_namespace_user)" | rails c
- Create a top-level group
- Create a Group Access Token (instructions) with
Developer
role for the group you created - Validate that the Group Access Token bot user is in the group's members table
- Ban the Group Access Token bot user via Rails console
> group = Group.last # assuming the group you created in step 3 is the most recent group created > bot = User.find_by(username: "group_#{group.id}_bot") # assuming this is the first Group Access Token created for the group > ::Namespaces::NamespaceBan.create(user: bot, namespace: group)
- Validate that the Group Access Token bot user is displayed in the group's banned members table
- Validate that
Unban
button is displayed for the bot user row
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Eugie Limpin