diff options
author | Douwe Maan <douwe@selenight.nl> | 2016-08-10 22:36:58 -0500 |
---|---|---|
committer | Fatih Acet <acetfatih@gmail.com> | 2016-08-12 23:24:50 +0300 |
commit | 9eca67c950829698dabb93102804a6ddf89d5f8d (patch) | |
tree | 6bfe29d710c1f2e90d30e3b378c1d3a11bf4a13a /app/models/merge_request.rb | |
parent | cf4cbb018e229b80e8fd0ca427e63f337ef6bdff (diff) | |
download | gitlab-ce-9eca67c950829698dabb93102804a6ddf89d5f8d.tar.gz |
Verify user is signed in and can actually resolve conflicts
Diffstat (limited to 'app/models/merge_request.rb')
-rw-r--r-- | app/models/merge_request.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/app/models/merge_request.rb b/app/models/merge_request.rb index b41d3b6891a..c1e95b1bfbf 100644 --- a/app/models/merge_request.rb +++ b/app/models/merge_request.rb @@ -720,6 +720,11 @@ class MergeRequest < ActiveRecord::Base @conflicts ||= Gitlab::Conflict::FileCollection.new(self) end + def conflicts_can_be_resolved_by?(user) + access = ::Gitlab::UserAccess.new(user, project: source_project) + access.can_push_to_branch?(source_branch) + end + def conflicts_can_be_resolved_in_ui? return @conflicts_can_be_resolved_in_ui if defined?(@conflicts_can_be_resolved_in_ui) |