Class: Ci::PipelinePolicy
- Inherits:
-
BasePolicy
- Object
- DeclarativePolicy::Base
- BasePolicy
- Ci::PipelinePolicy
- Defined in:
- app/policies/ci/pipeline_policy.rb
Direct Known Subclasses
Instance Attribute Summary
Attributes inherited from DeclarativePolicy::Base
Instance Method Summary collapse
Methods inherited from DeclarativePolicy::Base
ability_map, #allowed?, #banned?, #cache, #cached?, #can?, #condition, condition, conditions, configuration_for, #debug, delegate, #delegated_policies, delegations, desc, #disallowed?, enable_when, global_actions, #initialize, #inspect, last_options, last_options!, overrides, own_ability_map, own_conditions, own_delegations, own_global_actions, #policy_for, prevent_all_when, prevent_when, #repr, rule, #runner, with_options, with_scope, with_score
Constructor Details
This class inherits a constructor from DeclarativePolicy::Base
Instance Method Details
#ref_protected?(user, project, tag, ref) ⇒ Boolean
44 45 46 47 48 49 50 51 52 |
# File 'app/policies/ci/pipeline_policy.rb', line 44 def ref_protected?(user, project, tag, ref) access = ::Gitlab::UserAccess.new(user, container: project) if tag !access.can_create_tag?(ref) else !access.can_update_branch?(ref) end end |