Class: CommandTower::Configuration::AdminScope::ToolRegistration
- Inherits:
-
Object
- Object
- CommandTower::Configuration::AdminScope::ToolRegistration
- Defined in:
- lib/command_tower/configuration/admin_scope/tool_registration.rb
Constant Summary collapse
- BASE_HOOKS =
%i[options validate availability].freeze
- RESOURCE_NARROWING_HOOKS =
%i[narrow_users narrow_audit affected_users_in_scope].freeze
- RESOURCE_SCOPED_TOOL_IDS =
%w[users audit].freeze
Instance Attribute Summary collapse
-
#affected_users_in_scope ⇒ Object
Returns the value of attribute affected_users_in_scope.
-
#availability ⇒ Object
Returns the value of attribute availability.
-
#host_context_type ⇒ Object
Returns the value of attribute host_context_type.
-
#narrow_audit ⇒ Object
Returns the value of attribute narrow_audit.
-
#narrow_users ⇒ Object
Returns the value of attribute narrow_users.
-
#options ⇒ Object
Returns the value of attribute options.
-
#validate ⇒ Object
Returns the value of attribute validate.
Instance Method Summary collapse
Instance Attribute Details
#affected_users_in_scope ⇒ Object
Returns the value of attribute affected_users_in_scope.
11 12 13 |
# File 'lib/command_tower/configuration/admin_scope/tool_registration.rb', line 11 def affected_users_in_scope @affected_users_in_scope end |
#availability ⇒ Object
Returns the value of attribute availability.
11 12 13 |
# File 'lib/command_tower/configuration/admin_scope/tool_registration.rb', line 11 def availability @availability end |
#host_context_type ⇒ Object
Returns the value of attribute host_context_type.
11 12 13 |
# File 'lib/command_tower/configuration/admin_scope/tool_registration.rb', line 11 def host_context_type @host_context_type end |
#narrow_audit ⇒ Object
Returns the value of attribute narrow_audit.
11 12 13 |
# File 'lib/command_tower/configuration/admin_scope/tool_registration.rb', line 11 def narrow_audit @narrow_audit end |
#narrow_users ⇒ Object
Returns the value of attribute narrow_users.
11 12 13 |
# File 'lib/command_tower/configuration/admin_scope/tool_registration.rb', line 11 def narrow_users @narrow_users end |
#options ⇒ Object
Returns the value of attribute options.
11 12 13 |
# File 'lib/command_tower/configuration/admin_scope/tool_registration.rb', line 11 def @options end |
#validate ⇒ Object
Returns the value of attribute validate.
11 12 13 |
# File 'lib/command_tower/configuration/admin_scope/tool_registration.rb', line 11 def validate @validate end |
Instance Method Details
#validate!(tool_id:) ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/command_tower/configuration/admin_scope/tool_registration.rb', line 14 def validate!(tool_id:) missing = required_hooks_for(tool_id).reject { |hook| callable?(public_send(hook)) } return self if missing.empty? raise CommandTower::AdminScope::InvalidToolRegistrationError, "admin scope registration for #{tool_id} is missing hooks: #{missing.join(", ")}" end |