Class: Textus::Application::Policy::Predicates::AcceptAuthoritySigned
- Inherits:
-
Object
- Object
- Textus::Application::Policy::Predicates::AcceptAuthoritySigned
- Defined in:
- lib/textus/application/policy/predicates/accept_authority_signed.rb
Overview
Promotion predicate: the role driving the promotion must have role_kind == :accept_authority in the active manifest.
Accept/Reject already gate on this kind before reaching the promotion policy, so in the default control-flow this predicate trivially passes. It is kept so manifests can express the requirement explicitly in ‘rules[].promotion.requires`.
Instance Attribute Summary collapse
-
#reason ⇒ Object
readonly
Returns the value of attribute reason.
Instance Method Summary collapse
-
#call(role:, manifest:, entry: nil) ⇒ Object
rubocop:disable Lint/UnusedMethodArgument.
- #name ⇒ Object
Instance Attribute Details
#reason ⇒ Object (readonly)
Returns the value of attribute reason.
13 14 15 |
# File 'lib/textus/application/policy/predicates/accept_authority_signed.rb', line 13 def reason @reason end |
Instance Method Details
#call(role:, manifest:, entry: nil) ⇒ Object
rubocop:disable Lint/UnusedMethodArgument
19 20 21 22 23 24 25 26 27 28 |
# File 'lib/textus/application/policy/predicates/accept_authority_signed.rb', line 19 def call(role:, manifest:, entry: nil) # rubocop:disable Lint/UnusedMethodArgument role_str = role&.to_s return true if role_str.nil? || role_str.empty? kind = manifest.role_kind(role_str) return true if kind == :accept_authority @reason = "role '#{role_str}' has kind '#{kind.inspect}', expected ':accept_authority'" false end |
#name ⇒ Object
15 16 17 |
# File 'lib/textus/application/policy/predicates/accept_authority_signed.rb', line 15 def name "accept_authority_signed" end |