diff options
author | Simon Knox <psimyn@gmail.com> | 2017-11-16 13:07:15 +1100 |
---|---|---|
committer | Simon Knox <psimyn@gmail.com> | 2017-11-17 15:02:31 +1100 |
commit | 237970d26fbb8d1c44104d6458f1ebfd03089aec (patch) | |
tree | 9d44e5424c40252a6da59bd4224afef5b82bc6ae | |
parent | 8093aad129c8edc97f1aadc18a613194fc63ae97 (diff) | |
download | gitlab-ce-237970d26fbb8d1c44104d6458f1ebfd03089aec.tar.gz |
add user permissions to mr entity
-rw-r--r-- | app/serializers/merge_request_entity.rb | 8 |
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 |