Class: Decidim::Consultations::Admin::QuestionPermissionsController

Inherits:
Admin::ResourcePermissionsController
  • Object
show all
Includes:
QuestionAdmin
Defined in:
app/controllers/decidim/consultations/admin/question_permissions_controller.rb

Overview

Controller that allows managing Questions permissions in the admin panel.

Instance Method Summary collapse

Instance Method Details

#editObject



20
21
22
23
# File 'app/controllers/decidim/consultations/admin/question_permissions_controller.rb', line 20

def edit
  enforce_permission_to :update, :question, question: current_question
  super
end

#permission_class_chainObject



16
17
18
# File 'app/controllers/decidim/consultations/admin/question_permissions_controller.rb', line 16

def permission_class_chain
  ::Decidim.permissions_registry.chain_for(::Decidim::Consultations::Admin::QuestionPermissionsController)
end

#return_pathObject



30
31
32
# File 'app/controllers/decidim/consultations/admin/question_permissions_controller.rb', line 30

def return_path
  consultation_questions_path current_consultation
end

#updateObject



25
26
27
28
# File 'app/controllers/decidim/consultations/admin/question_permissions_controller.rb', line 25

def update
  enforce_permission_to :update, :question, question: current_question
  super
end