Sha256: 010c2098e854753b56761a7886884e869e45b957e6f4d4c694d15dea29c5b189
Contents?: true
Size: 691 Bytes
Versions: 11
Compression:
Stored size: 691 Bytes
Contents
module Spina module Admin class AdminController < ::Spina::ApplicationController before_action :set_admin_locale before_action :authorize_spina_user def current_admin_path request.fullpath[%r{/#{ Spina.config.backend_path }(.*)}, 1] end helper_method :current_admin_path private def set_admin_locale I18n.locale = I18n.default_locale end def authorize_spina_user redirect_to admin_login_path, flash: {information: I18n.t('spina.notifications.login')} unless current_spina_user end def authorize_admin render status: 401 unless current_spina_user.admin? end end end end
Version data entries
11 entries across 11 versions & 1 rubygems