summaryrefslogtreecommitdiff
path: root/app/helpers/compare_helper.rb
diff options
context:
space:
mode:
authorToon Claes <toon@gitlab.com>2017-01-19 15:42:18 +0100
committerToon Claes <toon@gitlab.com>2017-01-20 09:39:58 +0100
commit7ce39486b54a375eb13a11deb1835d6fcf218a4a (patch)
treebc29d79073d82d3e81fefe5f1b3dc940ed7a908b /app/helpers/compare_helper.rb
parente2f0b83061df3b19b683b67d142acea65d5df0fd (diff)
downloadgitlab-ce-7ce39486b54a375eb13a11deb1835d6fcf218a4a.tar.gz
Only show Merge Request button when user can create a MR
The Create Merge Request button only should be shown when the user is allowed to create a Merge request.
Diffstat (limited to 'app/helpers/compare_helper.rb')
-rw-r--r--app/helpers/compare_helper.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/app/helpers/compare_helper.rb b/app/helpers/compare_helper.rb
index aa54ee07bdc..8fcb82f17d5 100644
--- a/app/helpers/compare_helper.rb
+++ b/app/helpers/compare_helper.rb
@@ -4,6 +4,7 @@ module CompareHelper
to.present? &&
from != to &&
project.feature_available?(:merge_requests, current_user) &&
+ can?(current_user, :create_merge_request, project) &&
project.repository.branch_names.include?(from) &&
project.repository.branch_names.include?(to)
end