I''ve used Aegis in the past for role-based authorisation, but have
seen a lot of talk about CanCan; so I thought I''d give it a go and
have been fiddling with it over the last couple of days. It seems to
have a slightly nicer DSL and simpler implementation for authorising
CRUD operations, but I''m stumped at the moment for how to have
arbitrary authorisations.
For instance; if I have some users that are allowed to give away free
products, in Aegis I can have a permission method like this:
permission :give_trials do |user|
# role checks here
end
but how do I do the same thing in CanCan? It wants me to pass in a
Model, but for some checks there isn''t a 1:1 mapping.
Secondly, Aegis is an extension to the User model, while CanCan
extends the controller - so how can I test stuff in the console with
CanCan?
--
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.