Fix push access check when not signed in.

This commit is contained in:
Douwe Maan 2015-02-18 21:59:15 +01:00
parent 0b8e41aae2
commit 3d6b042e9e
1 changed files with 2 additions and 0 deletions

View File

@ -6,6 +6,8 @@ module Gitlab
attr_reader :params, :project, :git_cmd, :user
def self.can_push_to_branch?(user, project, ref)
return false unless user
if project.protected_branch?(ref) &&
!(project.developers_can_push_to_protected_branch?(ref) && project.team.developer?(user))
user.can?(:push_code_to_protected_branches, project)