Commit 096ad222 authored by Etienne Baqué's avatar Etienne Baqué

Put new call behind feature flag

parent ae1f26ee
...@@ -14,9 +14,17 @@ module Gitlab ...@@ -14,9 +14,17 @@ module Gitlab
private private
def can_push? def can_push?
user_access.can_push_to_branch?(ref) || user_access_can_push? ||
project.branch_allows_collaboration?(user_access.user, branch_name) project.branch_allows_collaboration?(user_access.user, branch_name)
end end
def user_access_can_push?
if Feature.enabled?(:deploy_keys_on_protected_branches, project)
user_access.can_push_to_branch?(ref)
else
user_access.can_do_action?(:push_code)
end
end
end end
end end
end end
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