You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
bbenezech edited this page Nov 29, 2011
·
4 revisions
Declarative Authorization is not fully integrated into Rails Admin, so it is only possible to add permissions to the controller actions. Currently if you want more integrated authorization, consider CanCan.
You can hook declarative_authorization into Rails Admin using code like this in an initializer (e.g., config/initializers/rails_admin.rb):
By default, access to the controllers will be denied to all users, so
you need to write some authz rules so that the appropriate users can
get access. These rules will vary, but here's an example:
This will allow the :admin role to do everything, and will prevent all
other roles from doing anything.
Authorization Adapter
If you would like better support for Declarative Authorization in Rails Admin, consider making an authorization adapter for it. See the CanCan Adapter for an example. Fork the project, add the adapter, and send a pull request.