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



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

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



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

def index
  enforce_permission_to :read, :moderate_users

  @moderated_users = filtered_collection
end