Class: Decidim::DirectVerifications::Verification::Admin::DirectVerificationsController

Inherits:
Admin::ApplicationController
  • Object
show all
Includes:
NeedsPermission
Defined in:
app/controllers/decidim/direct_verifications/verification/admin/direct_verifications_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'app/controllers/decidim/direct_verifications/verification/admin/direct_verifications_controller.rb', line 17

def create
  enforce_permission_to :create, :authorization

  @userslist = params[:userslist]

  @processor = UserProcessor.new(current_organization, current_user, session, instrumenter)
  @processor.emails = parser_class.new(@userslist).to_h
  @processor.authorization_handler = current_authorization_handler

  @stats = UserStats.new(current_organization)
  @stats.authorization_handler = @processor.authorization_handler

  register_users
  authorize_users
  revoke_users

  render(action: :index) && return if show_users_info

  redirect_to direct_verifications_path
rescue InputParserError => e
  flash[:error] = e.message
  redirect_to direct_verifications_path
end

#indexObject



13
14
15
# File 'app/controllers/decidim/direct_verifications/verification/admin/direct_verifications_controller.rb', line 13

def index
  enforce_permission_to :index, :authorization
end