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

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

Overview

Controller that allows managing Questions permissions in the admin panel.

Instance Method Summary collapse

Methods inherited from Admin::ApplicationController

#permission_scope, #user_has_no_permission_path, #user_not_authorized_path

Methods included from HttpCachingDisabler

#disable_http_caching

Methods included from NeedsSnippets

#snippets

Methods included from RegistersPermissions

register_permissions

Methods included from NeedsOrganization

enhance_controller, extended, included

Instance Method Details

#editObject


20
21
22
23
# File 'decidim-consultations/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 'decidim-consultations/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 'decidim-consultations/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 'decidim-consultations/app/controllers/decidim/consultations/admin/question_permissions_controller.rb', line 25

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