Sha256: 8c9e6c56fa015af392854e14c072ac520e74ff523ddfa8edc602bb04258147ac

Contents?: true

Size: 1008 Bytes

Versions: 44

Compression:

Stored size: 1008 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Admin
    module Moderations
      # This controller allows admins to manage reports in a moderation.
      class ReportsController < Decidim::Admin::ApplicationController
        helper_method :moderation, :reports, :permission_resource

        def index
          enforce_permission_to :read, permission_resource
        end

        def show
          enforce_permission_to :read, permission_resource
          @report = reports.find(params[:id])
        end

        private

        def reports
          @reports ||= moderation.reports
        end

        def moderation
          @moderation ||= participatory_space_moderations.find(params[:moderation_id])
        end

        def participatory_space_moderations
          @participatory_space_moderations ||= Decidim::Moderation.where(participatory_space: current_participatory_space)
        end

        def permission_resource
          :moderation
        end
      end
    end
  end
end

Version data entries

44 entries across 44 versions & 1 rubygems

Version Path
decidim-admin-0.28.4 app/controllers/decidim/admin/moderations/reports_controller.rb
decidim-admin-0.27.9 app/controllers/decidim/admin/moderations/reports_controller.rb
decidim-admin-0.28.3 app/controllers/decidim/admin/moderations/reports_controller.rb
decidim-admin-0.27.8 app/controllers/decidim/admin/moderations/reports_controller.rb
decidim-admin-0.28.2 app/controllers/decidim/admin/moderations/reports_controller.rb
decidim-admin-0.27.7 app/controllers/decidim/admin/moderations/reports_controller.rb
decidim-admin-0.28.1 app/controllers/decidim/admin/moderations/reports_controller.rb
decidim-admin-0.27.6 app/controllers/decidim/admin/moderations/reports_controller.rb
decidim-admin-0.26.10 app/controllers/decidim/admin/moderations/reports_controller.rb
decidim-admin-0.26.9 app/controllers/decidim/admin/moderations/reports_controller.rb
decidim-admin-0.28.0 app/controllers/decidim/admin/moderations/reports_controller.rb
decidim-admin-0.27.5 app/controllers/decidim/admin/moderations/reports_controller.rb
decidim-admin-0.28.0.rc5 app/controllers/decidim/admin/moderations/reports_controller.rb
decidim-admin-0.28.0.rc4 app/controllers/decidim/admin/moderations/reports_controller.rb
decidim-admin-0.26.8 app/controllers/decidim/admin/moderations/reports_controller.rb
decidim-admin-0.27.4 app/controllers/decidim/admin/moderations/reports_controller.rb
decidim-admin-0.27.3 app/controllers/decidim/admin/moderations/reports_controller.rb
decidim-admin-0.26.7 app/controllers/decidim/admin/moderations/reports_controller.rb
decidim-admin-0.26.5 app/controllers/decidim/admin/moderations/reports_controller.rb
decidim-admin-0.27.2 app/controllers/decidim/admin/moderations/reports_controller.rb