Class: Decidim::Kids::CloseSessionManagedMinor
- Inherits:
-
Command
- Object
- Command
- Decidim::Kids::CloseSessionManagedMinor
- Defined in:
- app/commands/decidim/kids/close_session_managed_minor.rb
Overview
A command with all the business logic to close a current impersonation session.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(current_user, real_user) ⇒ CloseSessionManagedMinor
constructor
Public: Initializes the command.
Constructor Details
#initialize(current_user, real_user) ⇒ CloseSessionManagedMinor
Public: Initializes the command.
real_user - The user impersonating a minor current_user - The user to impersonate
11 12 13 14 |
# File 'app/commands/decidim/kids/close_session_managed_minor.rb', line 11 def initialize(current_user, real_user) @real_user = real_user @current_user = current_user end |
Instance Method Details
#call ⇒ Object
16 17 18 19 20 21 22 |
# File 'app/commands/decidim/kids/close_session_managed_minor.rb', line 16 def call return broadcast(:invalid) if impersonation_log.blank? close_session broadcast(:ok) end |