Module: Sipity::Commands::AccountPlaceholderCommands

Extended by:
ActiveSupport::Concern
Defined in:
app/repositories/sipity/commands/account_placeholder_commands.rb

Overview

Commands

Instance Method Summary collapse

Instance Method Details

#submit_create_orcid_account_placeholder_form(form, requested_by:) ⇒ Object



12
13
14
15
16
17
18
19
20
# File 'app/repositories/sipity/commands/account_placeholder_commands.rb', line 12

def (form, requested_by:)
  form.submit do |f|
    identifier_type = Models::AccountPlaceholder::ORCID_IDENTIFIER_TYPE
    placeholder = Models::AccountPlaceholder.create!(identifier: f.identifier, identifier_type: identifier_type, name: f.name)
    PermissionCommands.grant_creating_user_permission_for!(entity: placeholder, user: requested_by)
    EventLogCommands.log_event!(entity: placeholder, user: requested_by, event_name: __method__)
    placeholder
  end
end