Class: Yes::Core::Authorization::CommandAuthorizer Abstract
- Inherits:
-
Object
- Object
- Yes::Core::Authorization::CommandAuthorizer
- Extended by:
- OpenTelemetry::Trackable
- Includes:
- OpenTelemetry::Trackable
- Defined in:
- lib/yes/core/authorization/command_authorizer.rb
Overview
This class is abstract.
command authorizer base class. Subclass and override call method to implement
a custom authorizer.
Direct Known Subclasses
Constant Summary collapse
Class Method Summary collapse
-
.call(_command, auth_data) ⇒ Boolean
Implement this method to authorize a command.
Class Method Details
.call(_command, auth_data) ⇒ Boolean
Implement this method to authorize a command. Needs to return true if command is authorized, otherwise raise CommandNotAuthorized.
21 22 23 24 25 26 |
# File 'lib/yes/core/authorization/command_authorizer.rb', line 21 def call(_command, auth_data) return true if super_admin?(auth_data) current_span&.status = ::OpenTelemetry::Trace::Status.error('Command not authorized') raise CommandNotAuthorized end |