refactor Ci::CreatePipelineService#allowed_to_create?
This commit is contained in:
parent
2a54cbcab8
commit
9151ca7bb3
|
@ -96,9 +96,9 @@ module Ci
|
|||
end
|
||||
|
||||
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?
|
||||
access.can_update_branch?(ref)
|
||||
elsif tag?
|
||||
|
|
Loading…
Reference in New Issue