Skip to content

Customized authorization

bbenezech edited this page Jan 4, 2012 · 13 revisions

You have access to the controller ('this'), 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 
    redirect_to root_path unless current_user.try(:admin?)
  end
end
Clone this wiki locally