Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
096ad222
Commit
096ad222
authored
Dec 09, 2020
by
Etienne Baqué
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Put new call behind feature flag
parent
ae1f26ee
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
1 deletion
+9
-1
lib/gitlab/checks/push_check.rb
lib/gitlab/checks/push_check.rb
+9
-1
No files found.
lib/gitlab/checks/push_check.rb
View file @
096ad222
...
...
@@ -14,9 +14,17 @@ module Gitlab
private
def
can_push?
user_access
.
can_push_to_branch?
(
ref
)
||
user_access
_can_push?
||
project
.
branch_allows_collaboration?
(
user_access
.
user
,
branch_name
)
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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment