diff options
author | Bob Van Landuyt <bob@vanlanduyt.co> | 2018-04-06 20:19:37 +0200 |
---|---|---|
committer | Bob Van Landuyt <bob@vanlanduyt.co> | 2018-04-11 10:51:43 +0200 |
commit | 04c7d0d55500e6f118bd17153f3af11e83fce826 (patch) | |
tree | 7976d051ad4138dd020e78e2fd616f0791bd7123 /app/serializers | |
parent | 71ccfde322b633e9245bee6acba1e64cb7640f19 (diff) | |
download | gitlab-ce-04c7d0d55500e6f118bd17153f3af11e83fce826.tar.gz |
Prevent awarding emoji when a project is archived
This prevents performing the requests, and disables all emoji reaction buttons
Diffstat (limited to 'app/serializers')
-rw-r--r-- | app/serializers/issue_entity.rb | 4 | ||||
-rw-r--r-- | app/serializers/note_entity.rb | 4 |
2 files changed, 8 insertions, 0 deletions
diff --git a/app/serializers/issue_entity.rb b/app/serializers/issue_entity.rb index b5e2334b6e3..840fdbcbf14 100644 --- a/app/serializers/issue_entity.rb +++ b/app/serializers/issue_entity.rb @@ -29,6 +29,10 @@ class IssueEntity < IssuableEntity expose :can_update do |issue| can?(request.current_user, :update_issue, issue) end + + expose :can_award_emoji do |issue| + can?(request.current_user, :award_emoji, issue) + end end expose :create_note_path do |issue| diff --git a/app/serializers/note_entity.rb b/app/serializers/note_entity.rb index fa516fee6ec..06d603b277e 100644 --- a/app/serializers/note_entity.rb +++ b/app/serializers/note_entity.rb @@ -17,6 +17,10 @@ class NoteEntity < API::Entities::Note expose :can_edit do |note| Ability.allowed?(request.current_user, :admin_note, note) end + + expose :can_award_emoji do |note| + Ability.allowed?(request.current_user, :award_emoji, note) + end end expose :resolved?, as: :resolved |