Sha256: 2e2d5857f0420d31a2b8c877595a7c41f7535503a4c7b390a5ba21529c913170
Contents?: true
Size: 907 Bytes
Versions: 14
Compression:
Stored size: 907 Bytes
Contents
module RailsAdminImageManager class ApplicationController < ActionController::Base protect_from_forgery with: :exception before_action :_authenticate! before_action :_authorize! before_action :_check_permissions def _current_user instance_eval(&RailsAdmin::Config.current_user_method) end private def _authenticate! instance_eval(&RailsAdmin::Config.authenticate_with) end def _authorize! instance_eval(&RailsAdmin::Config.authorize_with) end def _check_permissions(action=:read) @authorization_adapter.try(:authorize, action, file_model) end def file_model RailsAdmin::AbstractModel.new(to_model_name("::RailsAdminImageManager::File")) end def to_model_name(param) param.split('~').collect(&:camelize).join('::') end def filter_by?(param) params[param].present? end end end
Version data entries
14 entries across 14 versions & 1 rubygems