Sha256: f3de770ad21cfbd1f060fe891dfff9d7ebb91d3ef12f347012ffdf1f5ecbe1be

Contents?: true

Size: 627 Bytes

Versions: 4

Compression:

Stored size: 627 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Proposals
    class WidgetsController < Decidim::WidgetsController
      helper Proposals::ApplicationHelper

      def show
        enforce_permission_to :embed, :proposal, proposal: model if model

        super
      end

      private

      def model
        @model ||= Proposal.not_hidden.except_withdrawn.where(component: current_component).find(params[:proposal_id])
      end

      def iframe_url
        @iframe_url ||= proposal_widget_url(model)
      end

      def permission_class_chain
        [Decidim::Proposals::Permissions]
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
decidim-proposals-0.27.9 app/controllers/decidim/proposals/widgets_controller.rb
decidim-proposals-0.27.8 app/controllers/decidim/proposals/widgets_controller.rb
decidim-proposals-0.27.7 app/controllers/decidim/proposals/widgets_controller.rb
decidim-proposals-0.27.6 app/controllers/decidim/proposals/widgets_controller.rb