Class: Decidim::Admin::ModeratedUsersController

Inherits:
ApplicationController show all
Includes:
ModeratedUsers::Admin::Filterable
Defined in:
app/controllers/decidim/admin/moderated_users_controller.rb

Instance Method Summary collapse

Methods inherited from ApplicationController

#permission_class_chain, #permission_scope, #user_has_no_permission_path, #user_not_authorized_path

Instance Method Details

#ignoreObject



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'app/controllers/decidim/admin/moderated_users_controller.rb', line 18

def ignore
  enforce_permission_to :unreport, :moderate_users

  Admin::UnreportUser.call(reportable, current_user) do
    on(:ok) do
      flash[:notice] = I18n.t("reportable.unreport.success", scope: "decidim.moderations.admin")
      redirect_to moderated_users_path
    end

    on(:invalid) do
      flash.now[:alert] = I18n.t("reportable.unreport.invalid", scope: "decidim.moderations.admin")
      redirect_to moderated_users_path
    end
  end
end

#indexObject



12
13
14
15
16
# File 'app/controllers/decidim/admin/moderated_users_controller.rb', line 12

def index
  enforce_permission_to :read, :moderate_users

  @moderated_users = filtered_collection
end