Sha256: 4f19b9da3595d8fac41b32aef9e4c22008da714141b450aa58e232616a09afa1
Contents?: true
Size: 1.68 KB
Versions: 3
Compression:
Stored size: 1.68 KB
Contents
# frozen_string_literal: true require "active_support/concern" module Decidim # This concern groups methods and helpers needed by Devise controllers. module DeviseControllers extend ActiveSupport::Concern RegistersPermissions .register_permissions(::Decidim::DeviseControllers, ::Decidim::Admin::Permissions, ::Decidim::Permissions) included do include Decidim::NeedsOrganization include Decidim::LocaleSwitcher include ImpersonateUsers include NeedsRtlDirection include NeedsPermission include Decidim::SafeRedirect include NeedsSnippets include UserBlockedChecker helper Decidim::TranslationsHelper helper Decidim::MetaTagsHelper helper Decidim::DecidimFormHelper helper Decidim::LanguageChooserHelper helper Decidim::ReplaceButtonsHelper helper Decidim::LayoutHelper helper Decidim::MenuHelper helper Decidim::BreadcrumbHelper helper Decidim::OmniauthHelper helper Decidim::CacheHelper helper Decidim::SocialShareButtonHelper helper Decidim::SanitizeHelper helper Decidim::ApplicationHelper layout "layouts/decidim/application" # Saves the location before loading each page so we can return to the # right page. before_action :store_current_location def permission_class_chain PermissionsRegistry.chain_for(DeviseControllers) end def permission_scope :public end def store_current_location return if redirect_url.blank? || !request.format.html? store_location_for(:user, redirect_url) end end end end
Version data entries
3 entries across 3 versions & 1 rubygems