diff options
author | Robert Schilling <2900-razer6@users.noreply.gitlab.com> | 2019-02-14 16:32:44 +0000 |
---|---|---|
committer | Nick Thomas <nick@gitlab.com> | 2019-02-14 16:32:44 +0000 |
commit | cd6af77f9509bd4b21e740c1d7b5d927c6887ac0 (patch) | |
tree | 3c383f4b3defa449e7747cf29ace5b80d29a58f1 /lib/api/entities.rb | |
parent | 6d1273cf2afb5ee72110e575ba537569670cf8fb (diff) | |
download | gitlab-ce-cd6af77f9509bd4b21e740c1d7b5d927c6887ac0.tar.gz |
API: Expose if the user can merge a given merge request
Diffstat (limited to 'lib/api/entities.rb')
-rw-r--r-- | lib/api/entities.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/api/entities.rb b/lib/api/entities.rb index f3ff7e10eb7..af788a4ed73 100644 --- a/lib/api/entities.rb +++ b/lib/api/entities.rb @@ -732,6 +732,12 @@ module API def build_available?(options) options[:project]&.feature_available?(:builds, options[:current_user]) end + + expose :user do + expose :can_merge do |merge_request, options| + merge_request.can_be_merged_by?(options[:current_user]) + end + end end class MergeRequestChanges < MergeRequest |