Commit 68112433 authored by Grzegorz Bizon's avatar Grzegorz Bizon

Merge branch '33207-show-delete-option-in-admin-users-page' into 'master'

Allow admins to delete users from the admin users page

Closes #33207

See merge request !11852
parents 063ad525 05e98306
......@@ -34,7 +34,7 @@
- if user.access_locked?
%li
= link_to 'Unlock', unlock_admin_user_path(user), method: :put, class: 'btn-grouped btn btn-xs btn-success', data: { confirm: 'Are you sure?' }
- if user.can_be_removed? && can?(current_user, :destroy_user, @user)
- if user.can_be_removed? && can?(current_user, :destroy_user, user)
%li.divider
%li
= link_to 'Delete user', [:admin, user], data: { confirm: "USER #{user.name} WILL BE REMOVED! All issues, merge requests and groups linked to this user will also be removed! Consider cancelling this deletion and blocking the user instead. Are you sure?" },
......
---
title: Allow admins to delete users from the admin users page
merge_request: 11852
author:
......@@ -21,6 +21,8 @@ describe "Admin::Users", feature: true do
expect(page).to have_content(current_user.name)
expect(page).to have_content(user.email)
expect(page).to have_content(user.name)
expect(page).to have_link('Block', href: block_admin_user_path(user))
expect(page).to have_link('Delete', href: admin_user_path(user))
end
describe 'Two-factor Authentication filters' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment