diff options
author | Phil Hughes <me@iamphill.com> | 2017-08-30 16:49:22 +0100 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2017-08-30 16:49:22 +0100 |
commit | 4d2d744ae9a2d4c3bb0f00805c27704b79e00d72 (patch) | |
tree | 839b1c3ab4c09c80f7d643fe69dae8a83c4e4eb4 /lib/api/notes.rb | |
parent | 25a3b7fab905d09f6f064108f457a4e20c8915ff (diff) | |
parent | f7c8434c7100c3c87eb2a75cd5a128e520d8c110 (diff) | |
download | gitlab-ce-enable-new-navigaton-by-default.tar.gz |
Merge branch 'master' into enable-new-navigaton-by-defaultenable-new-navigaton-by-default
Diffstat (limited to 'lib/api/notes.rb')
-rw-r--r-- | lib/api/notes.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/api/notes.rb b/lib/api/notes.rb index 4e4e473994b..e116448c15b 100644 --- a/lib/api/notes.rb +++ b/lib/api/notes.rb @@ -129,10 +129,12 @@ module API end delete ":id/#{noteables_str}/:noteable_id/notes/:note_id" do note = user_project.notes.find(params[:note_id]) + authorize! :admin_note, note - status 204 - ::Notes::DestroyService.new(user_project, current_user).execute(note) + destroy_conditionally!(note) do |note| + ::Notes::DestroyService.new(user_project, current_user).execute(note) + end end end end |