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
This commit is contained in:
Grzegorz Bizon 2017-06-02 11:18:50 +00:00
commit 68112433e1
3 changed files with 7 additions and 1 deletions

View file

@ -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?" },

View file

@ -0,0 +1,4 @@
---
title: Allow admins to delete users from the admin users page
merge_request: 11852
author:

View file

@ -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