diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-08-25 18:12:14 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-08-25 18:12:14 +0300 |
commit | 5f85444a43df1c5f025b520fdbc682cbf95d3ca0 (patch) | |
tree | a224ff70de072fe19ff19c0bfec2c5cafe966cc5 /app/serializers | |
parent | 73507eaf1a77c5c05ae17c9f7ac29bbeb8bf5be1 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/serializers')
-rw-r--r-- | app/serializers/merge_request_noteable_entity.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/app/serializers/merge_request_noteable_entity.rb b/app/serializers/merge_request_noteable_entity.rb index f8c8e3538da..bd0de3a72b9 100644 --- a/app/serializers/merge_request_noteable_entity.rb +++ b/app/serializers/merge_request_noteable_entity.rb @@ -40,6 +40,10 @@ class MergeRequestNoteableEntity < IssuableEntity expose :can_update do |merge_request| can?(current_user, :update_merge_request, merge_request) end + + expose :can_approve do |merge_request| + merge_request.can_be_approved_by?(current_user) + end end expose :locked_discussion_docs_path, if: -> (merge_request) { merge_request.discussion_locked? } do |merge_request| @@ -65,3 +69,5 @@ class MergeRequestNoteableEntity < IssuableEntity @presenters[merge_request] ||= MergeRequestPresenter.new(merge_request, current_user: current_user) # rubocop: disable CodeReuse/Presenter end end + +MergeRequestNoteableEntity.prepend_mod_with('MergeRequestNoteableEntity') |