Reputation: 950
I have a Rails application using Restful authentication and declarative authorization. I have some roles with an admin.
Is there any method to have automatically granted all permissions to this role, instead of hardcode every controller in the authorization_rules? Something like:
role :admin do
has_permission_on :everything, :to => :manage
end
Or a uglier approach with introspection, maybe?
Thanks in advance
Upvotes: 2
Views: 605
Reputation: 11596
You can use this if you use the latest code (the latest gem (0.4.1) still doesn't have it):
role :admin do
has_omnipotence
end
With that the admin role would have all permissions on all models.
See the commit: 4ecb402f
Upvotes: 4