Class: Decidim::ParticipatoryProcesses::ParticipatoryProcessesController

Inherits:
ApplicationController
  • Object
show all
Includes:
FilterResource, HasParticipatorySpaceContentBlocks, Paginable, ParticipatorySpaceContext
Defined in:
app/controllers/decidim/participatory_processes/participatory_processes_controller.rb

Overview

A controller that holds the logic to show ParticipatoryProcesses in a public layout.

Instance Method Summary collapse

Instance Method Details

#all_metricsObject



34
35
36
# File 'app/controllers/decidim/participatory_processes/participatory_processes_controller.rb', line 34

def all_metrics
  enforce_permission_to :read, :process, process: current_participatory_space
end

#indexObject

Raises:

  • (ActionController::RoutingError)


23
24
25
26
27
28
# File 'app/controllers/decidim/participatory_processes/participatory_processes_controller.rb', line 23

def index
  raise ActionController::RoutingError, "Not Found" if published_processes.none?

  enforce_permission_to :list, :process
  enforce_permission_to :list, :process_group
end

#showObject



30
31
32
# File 'app/controllers/decidim/participatory_processes/participatory_processes_controller.rb', line 30

def show
  enforce_permission_to :read, :process, process: current_participatory_space
end