Hi, I’m using Ryan Bate’s CanCan gem for my authorization (coupled
with Authlogic for my authentication). In his railscast, he uses a
boolean column in the database to define roles. However, my app is
super simple and only needs one Administrator, and everyone else has
the same permissions. How would I go about doing this?
I thought of something like:
user ||= User.new
if admin? can :manage, :all else can :read, :all can :create, Comment end
and then defining admin? as True if the current_user’s username was
admin, but I cant figure out where to put this, much less how to
accomplish this correctly. Any ideas?
Or, maybe there’s even a better way?