summaryrefslogtreecommitdiff
path: root/app/services/files/update_service.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/services/files/update_service.rb
parent148740cc6769b0faf7ee564552143ccd0a18768b (diff)
downloadgitlab-ce-ab7a79bf3bb47fd1c9d82da0bb29a3cdf0246cdc.tar.gz
developer can push to protected branches
Diffstat (limited to 'app/services/files/update_service.rb')
-rw-r--r--app/services/files/update_service.rb6
1 files changed, 1 insertions, 5 deletions
diff --git a/app/services/files/update_service.rb b/app/services/files/update_service.rb
index a0f40154db0..b4986e1c5c6 100644
--- a/app/services/files/update_service.rb
+++ b/app/services/files/update_service.rb
@@ -3,11 +3,7 @@ require_relative "base_service"
module Files
class UpdateService < BaseService
def execute
- allowed = if project.protected_branch?(ref)
- can?(current_user, :push_code_to_protected_branches, project)
- else
- can?(current_user, :push_code, project)
- end
+ allowed = ::Gitlab::GitAccess.can_push_to_branch?(current_user, project, ref)
unless allowed
return error("You are not allowed to push into this branch")