Commit 9151ca7b authored by Maxim Rydkin's avatar Maxim Rydkin

refactor Ci::CreatePipelineService#allowed_to_create?

parent 2a54cbca
...@@ -96,9 +96,9 @@ module Ci ...@@ -96,9 +96,9 @@ module Ci
end end
def allowed_to_create? def allowed_to_create?
access = Gitlab::UserAccess.new(current_user, project: project) return unless can?(current_user, :create_pipeline, project)
can?(current_user, :create_pipeline, project) && access = Gitlab::UserAccess.new(current_user, project: project)
if branch? if branch?
access.can_update_branch?(ref) access.can_update_branch?(ref)
elsif tag? elsif tag?
......
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