Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTiago Botelho <tiagonbotelho@hotmail.com>2018-01-03 19:01:46 +0300
committerTiago Botelho <tiagonbotelho@hotmail.com>2018-01-06 15:20:49 +0300
commit819fc98fed227487b0a273ee294e374e7457782b (patch)
tree9d8f3641fed389584f924b3698365e1d821cfd80 /app/services/protected_branches
parent1e950e3148d31cb3b242cb21be11e04964c2a037 (diff)
Protected branch is now created for default branch on import
Diffstat (limited to 'app/services/protected_branches')
-rw-r--r--app/services/protected_branches/create_service.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/services/protected_branches/create_service.rb b/app/services/protected_branches/create_service.rb
index a84e335340d..6212fd69077 100644
--- a/app/services/protected_branches/create_service.rb
+++ b/app/services/protected_branches/create_service.rb
@@ -2,8 +2,8 @@ module ProtectedBranches
class CreateService < BaseService
attr_reader :protected_branch
- def execute
- raise Gitlab::Access::AccessDeniedError unless can?(current_user, :admin_project, project)
+ def execute(skip_authorization: false)
+ raise Gitlab::Access::AccessDeniedError unless skip_authorization || can?(current_user, :admin_project, project)
project.protected_branches.create(params)
end