diff options
author | Rémy Coutable <remy@rymai.me> | 2016-10-24 15:25:37 +0200 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2016-10-24 15:25:37 +0200 |
commit | 0e43e34b45c6e1de68e65c8a51df078e850ec2c6 (patch) | |
tree | 09a1574a9a946ff7f3478bcd6665316e43f63789 /app | |
parent | 1f84dbaa9a56dd884240c8c4558163c74f53b413 (diff) | |
parent | ea6c5c1c0ee8f09fff4dbf02d7bfb65107020996 (diff) | |
download | gitlab-ce-0e43e34b45c6e1de68e65c8a51df078e850ec2c6.tar.gz |
Merge branch 'barthc/gitlab-ce-prevent_authored_vote_from_notes'
See merge request !6544.
Diffstat (limited to 'app')
-rw-r--r-- | app/services/notes/create_service.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/app/services/notes/create_service.rb b/app/services/notes/create_service.rb index a36008c3ef5..723cc0e6834 100644 --- a/app/services/notes/create_service.rb +++ b/app/services/notes/create_service.rb @@ -7,8 +7,10 @@ module Notes if note.award_emoji? noteable = note.noteable - todo_service.new_award_emoji(noteable, current_user) - return noteable.create_award_emoji(note.award_emoji_name, current_user) + if noteable.user_can_award?(current_user, note.award_emoji_name) + todo_service.new_award_emoji(noteable, current_user) + return noteable.create_award_emoji(note.award_emoji_name, current_user) + end end # We execute commands (extracted from `params[:note]`) on the noteable |