diff options
author | Phil Hughes <me@iamphill.com> | 2018-12-21 13:47:03 +0300 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2019-01-07 12:17:04 +0300 |
commit | aae6d174948a238abf05af2d3038d80b5e8750f4 (patch) | |
tree | 4fd28fc7358cb7602ffd527e152260c90a1f4da0 /app/serializers | |
parent | 301315f3b3e5ffe43c3de1f7f15e4e3a307c0912 (diff) |
Disable resolve conflicts for protected branches
Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/53463
Diffstat (limited to 'app/serializers')
-rw-r--r-- | app/serializers/merge_request_widget_entity.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/app/serializers/merge_request_widget_entity.rb b/app/serializers/merge_request_widget_entity.rb index 9731b52f1ad..9361c9f987b 100644 --- a/app/serializers/merge_request_widget_entity.rb +++ b/app/serializers/merge_request_widget_entity.rb @@ -11,6 +11,9 @@ class MergeRequestWidgetEntity < IssuableEntity expose :merge_user_id expose :merge_when_pipeline_succeeds expose :source_branch + expose :source_branch_protected do |merge_request| + merge_request.source_project.present? && ProtectedBranch.protected?(merge_request.source_project, merge_request.source_branch) + end expose :source_project_id expose :source_project_full_path do |merge_request| merge_request.source_project&.full_path @@ -240,6 +243,10 @@ class MergeRequestWidgetEntity < IssuableEntity expose :supports_suggestion?, as: :can_receive_suggestion + expose :conflicts_docs_path do |merge_request| + presenter(merge_request).conflicts_docs_path + end + private delegate :current_user, to: :request |