On Oct 5, 2012, at 7:46 AM, Avi wrote:

> Hello All,
> 
> Does cancan works without fetching roles data from db?
> Can we give permissions accordingly?
> Can we configure those roles like enum classes in java or in any config file?

The default setup (all I've ever done) is to configure the various roles in the 
ability.rb class file. If you look at the documentation or the RailsCast, 
that's what they start with. As far as looking up the current user to determine 
what role that user has, CanCan assumes you're using some authentication, which 
probably means looking up the user from the database, and that the 
authentication creates a current_user method that returns an object 
representing that authenticated user. CanCan doesn't get into the business of 
creating that current_user, though.

Walter

-- 
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@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to