diff options
author | Douwe Maan <douwe@selenight.nl> | 2017-08-31 09:13:41 +0200 |
---|---|---|
committer | Douwe Maan <douwe@selenight.nl> | 2017-08-31 09:13:41 +0200 |
commit | 7c215dd23dfa942d6b83252403ce326df96ab3ea (patch) | |
tree | 52c2d7bfa1a11beac6bb135c6eb425dd22d2e320 /lib/api/notes.rb | |
parent | a540f55c6e8ff64f7284ec4194f4c16ca711c685 (diff) | |
parent | d6e956d3a89fbb7f1a503f152fe9a4e2ca931d85 (diff) | |
download | gitlab-ce-7c215dd23dfa942d6b83252403ce326df96ab3ea.tar.gz |
Merge branch 'master' into issue-discussions-refactor
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 |