diff options
author | tiagonbotelho <tiagonbotelho@hotmail.com> | 2016-08-01 18:48:15 +0300 |
---|---|---|
committer | tiagonbotelho <tiagonbotelho@hotmail.com> | 2016-08-04 23:15:26 +0300 |
commit | 482d7802cc71280595cad71882bf1b438461e435 (patch) | |
tree | ba3258d6cb3f0a0fc848753152e5bd5baccdb0ee /lib/gitlab/user_access.rb | |
parent | edc5f4018e45327421e112de18d53bfbdabd38f9 (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.rb | 2 |
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 |