Skip to content
FMH edited this page Aug 28, 2015 · 8 revisions

Authorization can be added using the authorize_with method. If you pass a block it will be triggered through a before filter on every action in Rails Admin.

For example:

RailsAdmin.config do |config|
  config.authorize_with do
    redirect_to main_app.root_path unless current_user.is_admin?
  end
end

To use an authorization adapter, pass the name of the adapter. For example, to use with CanCanCan, pass it like this.

RailsAdmin.config do |config|
  config.authorize_with :cancan
end
Clone this wiki locally