Commit 05e98306 authored by Nick Thomas's avatar Nick Thomas

Allow admins to delete users from the admin users page

parent f07aee72
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
- if user.access_locked? - if user.access_locked?
%li %li
= link_to 'Unlock', unlock_admin_user_path(user), method: :put, class: 'btn-grouped btn btn-xs btn-success', data: { confirm: 'Are you sure?' } = 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.divider
%li %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?" }, = 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 ...@@ -21,6 +21,8 @@ describe "Admin::Users", feature: true do
expect(page).to have_content(current_user.name) expect(page).to have_content(current_user.name)
expect(page).to have_content(user.email) expect(page).to have_content(user.email)
expect(page).to have_content(user.name) 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 end
describe 'Two-factor Authentication filters' do 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