Sha256: a95fd72647928ad9f719c06ce9e0db40378383d6d769ffd2b9c2ec353cb96be3
Contents?: true
Size: 766 Bytes
Versions: 11
Compression:
Stored size: 766 Bytes
Contents
# frozen_string_literal: true module MrCommon class BaseController < MrCommon.base_controller_class layout "layouts/mr_common/layout" helper BadgeHelper before_action MrCommon.authentication_method_name if MrCommon.authentication_method_name.present? before_action :authorize_user if MrCommon.current_user_authorization_method_name.present? private def authorize_user user = send MrCommon.current_user_method_name authorized = user.send MrCommon.current_user_authorization_method_name redirect_to main_app.root_path, alert: "Not authorized" unless authorized end def render_not_found render file: File.join(Rails.root, "public", "404.html"), layout: false, status: 404 end end end
Version data entries
11 entries across 11 versions & 1 rubygems