Skip to content

Customized authorization

christophermanning edited this page Jun 23, 2012 · 10 revisions

You have access to the controller though self or with a block variable, you can decide wether the user should or should not be allowed to continue with something like:

# in config/initializer/rails_admin.rb

RailsAdmin.config do |config|
  config.authorize_with do |controller|
    redirect_to main_app.root_path unless current_user.try(:admin?)
  end
end
Clone this wiki locally