Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortiagonbotelho <tiagonbotelho@hotmail.com>2016-08-01 18:48:15 +0300
committertiagonbotelho <tiagonbotelho@hotmail.com>2016-08-04 23:15:26 +0300
commit482d7802cc71280595cad71882bf1b438461e435 (patch)
treeba3258d6cb3f0a0fc848753152e5bd5baccdb0ee /lib/gitlab/user_access.rb
parentedc5f4018e45327421e112de18d53bfbdabd38f9 (diff)
changes default_branch_protection to allow devs_can_merge protection option aswell
Diffstat (limited to 'lib/gitlab/user_access.rb')
-rw-r--r--lib/gitlab/user_access.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/gitlab/user_access.rb b/lib/gitlab/user_access.rb
index 3a69027368f..c55a7fc4d3d 100644
--- a/lib/gitlab/user_access.rb
+++ b/lib/gitlab/user_access.rb
@@ -30,6 +30,8 @@ module Gitlab
return false unless user
if project.protected_branch?(ref)
+ return true if project.empty_repo? && project.user_can_push_to_empty_repo?(user)
+
access_levels = project.protected_branches.matching(ref).map(&:push_access_level)
access_levels.any? { |access_level| access_level.check_access(user) }
else