summaryrefslogtreecommitdiff
path: root/app/helpers/branches_helper.rb
diff options
context:
space:
mode:
authorValery Sizov <valery@gitlab.com>2015-01-20 15:23:37 -0800
committerValery Sizov <valery@gitlab.com>2015-01-20 17:34:23 -0800
commitab7a79bf3bb47fd1c9d82da0bb29a3cdf0246cdc (patch)
tree7a32b98b19476c6ca633f9cb907f3f9c6e1f6bb8 /app/helpers/branches_helper.rb
parent148740cc6769b0faf7ee564552143ccd0a18768b (diff)
downloadgitlab-ce-ab7a79bf3bb47fd1c9d82da0bb29a3cdf0246cdc.tar.gz
developer can push to protected branches
Diffstat (limited to 'app/helpers/branches_helper.rb')
-rw-r--r--app/helpers/branches_helper.rb9
1 files changed, 2 insertions, 7 deletions
diff --git a/app/helpers/branches_helper.rb b/app/helpers/branches_helper.rb
index 2ec2cc96157..4a5edf6d101 100644
--- a/app/helpers/branches_helper.rb
+++ b/app/helpers/branches_helper.rb
@@ -11,12 +11,7 @@ module BranchesHelper
def can_push_branch?(project, branch_name)
return false unless project.repository.branch_names.include?(branch_name)
- action = if project.protected_branch?(branch_name)
- :push_code_to_protected_branches
- else
- :push_code
- end
-
- current_user.can?(action, project)
+
+ ::Gitlab::GitAccess.can_push_to_branch?(current_user, project, branch_name)
end
end