summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Knox <psimyn@gmail.com>2017-11-16 13:07:15 +1100
committerSimon Knox <psimyn@gmail.com>2017-11-17 15:02:31 +1100
commit237970d26fbb8d1c44104d6458f1ebfd03089aec (patch)
tree9d44e5424c40252a6da59bd4224afef5b82bc6ae
parent8093aad129c8edc97f1aadc18a613194fc63ae97 (diff)
downloadgitlab-ce-237970d26fbb8d1c44104d6458f1ebfd03089aec.tar.gz
add user permissions to mr entity
-rw-r--r--app/serializers/merge_request_entity.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/app/serializers/merge_request_entity.rb b/app/serializers/merge_request_entity.rb
index b53a49fe59e..018e04dba2d 100644
--- a/app/serializers/merge_request_entity.rb
+++ b/app/serializers/merge_request_entity.rb
@@ -95,6 +95,14 @@ class MergeRequestEntity < IssuableEntity
expose :can_cherry_pick_on_current_merge_request do |merge_request|
presenter(merge_request).can_cherry_pick_on_current_merge_request?
end
+
+ expose :can_create_note do |issue|
+ can?(request.current_user, :create_note, issue.project)
+ end
+
+ expose :can_update do |issue|
+ can?(request.current_user, :update_issue, issue)
+ end
end
# Paths