Class: Decidim::Admin::GlobalModerationsController
- Inherits:
-
ModerationsController
- Object
- DecidimController
- ApplicationController
- ModerationsController
- Decidim::Admin::GlobalModerationsController
- Includes:
- GlobalModerationContext
- Defined in:
- app/controllers/decidim/admin/global_moderations_controller.rb
Overview
This controller allows admin users to manage all moderations from the participatory spaces they have access to.
Instance Method Summary collapse
-
#collection ⇒ Object
Private: This method is used by the ‘Filterable` concern as the base query without applying filtering and/or sorting options.
-
#reportable ⇒ Object
Private: fins the reportable of the specific moderation the user is trying to manage.
Methods inherited from ModerationsController
#hide, #index, #show, #unhide, #unreport
Methods inherited from ApplicationController
#permission_class_chain, #permission_scope, #user_has_no_permission_path, #user_not_authorized_path
Instance Method Details
#collection ⇒ Object
Private: This method is used by the ‘Filterable` concern as the base query without applying filtering and/or sorting options.
14 15 16 17 18 19 20 21 |
# File 'app/controllers/decidim/admin/global_moderations_controller.rb', line 14 def collection @collection ||= if params[:hidden] moderations_for_user.hidden else moderations_for_user.not_hidden end end |
#reportable ⇒ Object
Private: fins the reportable of the specific moderation the user is trying to manage.
Returns a resource implementing the ‘Decidim::Reportable` concern.
27 28 29 |
# File 'app/controllers/decidim/admin/global_moderations_controller.rb', line 27 def reportable @reportable ||= moderations_for_user.find(params[:id]).reportable end |