diff options
author | Nick Thomas <nick@gitlab.com> | 2017-06-01 17:14:39 +0100 |
---|---|---|
committer | Nick Thomas <nick@gitlab.com> | 2017-06-02 18:28:12 +0100 |
commit | c890c6aaf2939bc19292947bd8268d724fa7ddce (patch) | |
tree | 246f57f6c492801687adb9effd790f59a2d0909b /lib/api/users.rb | |
parent | 1bf76c7620396b5cbc59b168a67a4de3102457b3 (diff) | |
download | gitlab-ce-c890c6aaf2939bc19292947bd8268d724fa7ddce.tar.gz |
Allow users to be hard-deleted from the API
Diffstat (limited to 'lib/api/users.rb')
-rw-r--r-- | lib/api/users.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/api/users.rb b/lib/api/users.rb index 3d83720b7b9..2070dbd8bc7 100644 --- a/lib/api/users.rb +++ b/lib/api/users.rb @@ -286,13 +286,14 @@ module API end params do requires :id, type: Integer, desc: 'The ID of the user' + optional :hard_delete, type: Boolean, desc: "Whether to remove a user's contributions" end delete ":id" do authenticated_as_admin! user = User.find_by(id: params[:id]) not_found!('User') unless user - DeleteUserWorker.perform_async(current_user.id, user.id) + DeleteUserWorker.perform_async(current_user.id, user.id, hard_delete: params[:hard_delete]) end desc 'Block a user. Available only for admins.' |