Class: Decidim::ParticipatoryProcesses::ParticipatoryProcessesController

Inherits:
ApplicationController show all
Includes:
FilterResource, Decidim::ParticipatorySpaceContext
Defined in:
decidim-participatory_processes/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

Methods included from RegistersPermissions

register_permissions

Methods included from UserBlockedChecker

#check_user_block_status, #check_user_not_blocked

Methods included from NeedsSnippets

#snippets

Methods included from HttpCachingDisabler

#disable_http_caching

Methods included from HasStoredPath

#skip_store_location?, #store_current_location

Methods included from NeedsOrganization

enhance_controller, extended, included

Instance Method Details

#all_metricsObject


33
34
35
36
37
38
39
# File 'decidim-participatory_processes/app/controllers/decidim/participatory_processes/participatory_processes_controller.rb', line 33

def all_metrics
  if current_participatory_space.show_statistics
    enforce_permission_to :read, :process, process: current_participatory_space
  else
    render status: :not_found
  end
end

#indexObject

Raises:

  • (ActionController::RoutingError)

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

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

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

#showObject


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

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