Class: Decidim::Elections::TrusteeZone::ElectionsController

Inherits:
ApplicationController show all
Defined in:
decidim-elections/app/controllers/decidim/elections/trustee_zone/elections_controller.rb

Overview

Handles the KeyCeremony for trustee users

Instance Method Summary collapse

Methods included from UserProfile

#available_verification_workflows

Methods included from UserGroups

#enforce_user_groups_enabled

Methods included from UserBlockedChecker

#check_user_block_status, #check_user_not_blocked

Methods included from NeedsSnippets

#snippets

Methods included from Headers::HttpCachingDisabler

#disable_http_caching

Methods included from HasStoredPath

#skip_store_location?, #store_current_location

Methods included from RegistersPermissions

register_permissions

Methods included from NeedsOrganization

enhance_controller, extended, included

Instance Method Details

#showObject



10
11
12
# File 'decidim-elections/app/controllers/decidim/elections/trustee_zone/elections_controller.rb', line 10

def show
  enforce_permission_to :view, :election, trustee:
end

#updateObject



14
15
16
17
18
19
20
21
22
23
24
25
# File 'decidim-elections/app/controllers/decidim/elections/trustee_zone/elections_controller.rb', line 14

def update
  enforce_permission_to(:update, :election, trustee:)

  UpdateElectionBulletinBoardStatus.call(election, params[:status]) do
    on(:ok) do
      render :update
    end
    on(:invalid) do
      flash[:alert] = I18n.t("elections.update.error", scope: "decidim.elections.trustee_zone")
    end
  end
end