Class: Gitlab::Ci::Pipeline::Chain::Validate::Abilities
- Inherits:
-
Base
- Object
- Base
- Gitlab::Ci::Pipeline::Chain::Validate::Abilities
show all
- Includes:
- Allowable, Helpers
- Defined in:
- lib/gitlab/ci/pipeline/chain/validate/abilities.rb
Instance Attribute Summary
Attributes inherited from Base
#command, #config, #pipeline
Instance Method Summary
collapse
Methods included from Helpers
#error, #warning
Methods included from Allowable
#can?, #can_all?, #can_any?
Methods inherited from Base
#initialize
Instance Method Details
#break? ⇒ Boolean
34
35
36
|
# File 'lib/gitlab/ci/pipeline/chain/validate/abilities.rb', line 34
def break?
@pipeline.errors.any?
end
|
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
# File 'lib/gitlab/ci/pipeline/chain/validate/abilities.rb', line 12
def perform!
if project.pending_delete?
return error('Project is deleted!')
end
unless project.builds_enabled?
return error('Pipelines are disabled!')
end
if project.import_in_progress?
return error('You cannot run pipelines before project import is complete.')
end
unless allowed_to_create_pipeline?
return error('Insufficient permissions to create a new pipeline')
end
unless allowed_to_run_pipeline?
error("You do not have sufficient permission to run a pipeline on '#{command.ref}'. Please select a different branch or contact your administrator for assistance.")
end
end
|