Class: Decidim::DirectVerifications::Verification::Admin::StatsController

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

Instance Method Summary collapse

Instance Method Details

#indexObject



12
13
14
15
16
17
18
19
20
21
22
# File 'app/controllers/decidim/direct_verifications/verification/admin/stats_controller.rb', line 12

def index
  enforce_permission_to :index, :authorization
  stats = UserStats.new(current_organization)
  @stats = {
    t(".global") => stats_hash(stats)
  }
  current_organization.available_authorizations.map do |a|
    stats.authorization_handler = a
    @stats[t("#{a}.name", scope: "decidim.authorization_handlers")] = stats_hash(stats)
  end
end