BigW Consortium Gitlab

Commit e9d995ba by Douwe Maan Committed by Dmitriy Zaporozhets

Fix push access check when not signed in.

parent e0bfa89c
...@@ -6,6 +6,8 @@ module Gitlab ...@@ -6,6 +6,8 @@ module Gitlab
attr_reader :params, :project, :git_cmd, :user attr_reader :params, :project, :git_cmd, :user
def self.can_push_to_branch?(user, project, ref) def self.can_push_to_branch?(user, project, ref)
return false unless user
if project.protected_branch?(ref) && if project.protected_branch?(ref) &&
!(project.developers_can_push_to_protected_branch?(ref) && project.team.developer?(user)) !(project.developers_can_push_to_protected_branch?(ref) && project.team.developer?(user))
user.can?(:push_code_to_protected_branches, project) user.can?(:push_code_to_protected_branches, project)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment