Sha256: b0ba769ea775694b5627e5adb6b36557d9c2939fd3203aea051c45ce06bbe630
Contents?: true
Size: 620 Bytes
Versions: 3
Compression:
Stored size: 620 Bytes
Contents
# frozen_string_literal: true require "active_support/concern" module Decidim module Notify module NeedsAjaxRescue extend ActiveSupport::Concern included do class ::Decidim::ActionForbidden < StandardError end rescue_from ::Decidim::ActionForbidden, with: :user_has_no_permission # Overrides original user permissions handling to take into account ajax def user_has_no_permission return super unless request.xhr? render plain: t("actions.unauthorized", scope: "decidim.core"), status: :forbidden end end end end end
Version data entries
3 entries across 3 versions & 1 rubygems