Class: Decidim::Admin::GlobalModerationsController
- Inherits:
-
ModerationsController
- Object
- DecidimController
- ApplicationController
- ModerationsController
- Decidim::Admin::GlobalModerationsController
- Includes:
- GlobalModerationContext
- Defined in:
- decidim-admin/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
Filterableconcern 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.
- #selected_moderations ⇒ Object
Methods inherited from ModerationsController
#bulk_action, #hide, #index, #show, #unhide, #unreport
Methods inherited from ApplicationController
#permission_class_chain, #permission_scope, #user_has_no_permission_path, #user_not_authorized_path
Methods included from Headers::HttpCachingDisabler
Methods included from TranslatableAttributes
#attachment?, #default_locale?
Methods included from NeedsSnippets
Methods included from RegistersPermissions
Methods included from NeedsOrganization
enhance_controller, extended, included
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 'decidim-admin/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 'decidim-admin/app/controllers/decidim/admin/global_moderations_controller.rb', line 27 def reportable @reportable ||= moderations_for_user.find(params[:id]).reportable end |
#selected_moderations ⇒ Object
31 32 33 |
# File 'decidim-admin/app/controllers/decidim/admin/global_moderations_controller.rb', line 31 def selected_moderations @selected_moderations ||= moderations_for_user.where(id: params[:moderation_ids]) end |