Sha256: 46a5a944e90f2005f94ef5af147fa75777a660e24e7240934682d2a181bb1d08

Contents?: true

Size: 718 Bytes

Versions: 13

Compression:

Stored size: 718 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Surveys
    module SurveyHelper
      def no_permission
        cell "decidim/authorization_modal", authorizations
      end

      def resource
        questionnaire_for
      end

      def current_component
        @current_component ||= Decidim::Component.find(params[:component_id])
      end

      def authorization_action
        @authorization_action ||= params[:authorization_action]
      end

      def authorize_action_path(handler_name)
        authorizations.status_for(handler_name).current_path
      end

      def authorizations
        @authorizations ||= action_authorized_to(:answer, resource: questionnaire_for)
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
decidim-surveys-0.29.1 app/helpers/decidim/surveys/survey_helper.rb
decidim-surveys-0.28.4 app/helpers/decidim/surveys/survey_helper.rb
decidim-surveys-0.29.0 app/helpers/decidim/surveys/survey_helper.rb
decidim-surveys-0.28.3 app/helpers/decidim/surveys/survey_helper.rb
decidim-surveys-0.29.0.rc4 app/helpers/decidim/surveys/survey_helper.rb
decidim-surveys-0.29.0.rc3 app/helpers/decidim/surveys/survey_helper.rb
decidim-surveys-0.29.0.rc2 app/helpers/decidim/surveys/survey_helper.rb
decidim-surveys-0.29.0.rc1 app/helpers/decidim/surveys/survey_helper.rb
decidim-surveys-0.28.2 app/helpers/decidim/surveys/survey_helper.rb
decidim-surveys-0.28.1 app/helpers/decidim/surveys/survey_helper.rb
decidim-surveys-0.28.0 app/helpers/decidim/surveys/survey_helper.rb
decidim-surveys-0.28.0.rc5 app/helpers/decidim/surveys/survey_helper.rb
decidim-surveys-0.28.0.rc4 app/helpers/decidim/surveys/survey_helper.rb