Sha256: 00862d07c6ab129ca8338ed0b36c029bf7405468df85bc858c4ee19412ba3fc8

Contents?: true

Size: 1.07 KB

Versions: 51

Compression:

Stored size: 1.07 KB

Contents

# frozen_string_literal: true

module Decidim
  module Consultations
    module Admin
      # Controller that allows managing Questions
      # permissions in the admin panel.
      class QuestionPermissionsController < Decidim::Admin::ResourcePermissionsController
        include QuestionAdmin
        # layout "decidim/admin/Question"

        register_permissions(::Decidim::Consultations::Admin::QuestionPermissionsController,
                             ::Decidim::Consultations::Permissions,
                             ::Decidim::Admin::Permissions)

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

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

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

        def return_path
          consultation_questions_path current_consultation
        end
      end
    end
  end
end

Version data entries

51 entries across 51 versions & 1 rubygems

Version Path
decidim-consultations-0.27.9 app/controllers/decidim/consultations/admin/question_permissions_controller.rb
decidim-consultations-0.27.8 app/controllers/decidim/consultations/admin/question_permissions_controller.rb
decidim-consultations-0.27.7 app/controllers/decidim/consultations/admin/question_permissions_controller.rb
decidim-consultations-0.27.6 app/controllers/decidim/consultations/admin/question_permissions_controller.rb
decidim-consultations-0.26.10 app/controllers/decidim/consultations/admin/question_permissions_controller.rb
decidim-consultations-0.26.9 app/controllers/decidim/consultations/admin/question_permissions_controller.rb
decidim-consultations-0.27.5 app/controllers/decidim/consultations/admin/question_permissions_controller.rb
decidim-consultations-0.26.8 app/controllers/decidim/consultations/admin/question_permissions_controller.rb
decidim-consultations-0.27.4 app/controllers/decidim/consultations/admin/question_permissions_controller.rb
decidim-consultations-0.27.3 app/controllers/decidim/consultations/admin/question_permissions_controller.rb
decidim-consultations-0.26.7 app/controllers/decidim/consultations/admin/question_permissions_controller.rb
decidim-consultations-0.26.5 app/controllers/decidim/consultations/admin/question_permissions_controller.rb
decidim-consultations-0.27.2 app/controllers/decidim/consultations/admin/question_permissions_controller.rb
decidim-consultations-0.27.1 app/controllers/decidim/consultations/admin/question_permissions_controller.rb
decidim-consultations-0.26.4 app/controllers/decidim/consultations/admin/question_permissions_controller.rb
decidim-consultations-0.27.0 app/controllers/decidim/consultations/admin/question_permissions_controller.rb
decidim-consultations-0.26.3 app/controllers/decidim/consultations/admin/question_permissions_controller.rb
decidim-consultations-0.27.0.rc2 app/controllers/decidim/consultations/admin/question_permissions_controller.rb
decidim-consultations-0.27.0.rc1 app/controllers/decidim/consultations/admin/question_permissions_controller.rb
decidim-consultations-0.26.2 app/controllers/decidim/consultations/admin/question_permissions_controller.rb