The below is my class Ability. It means if you are admin you can do everything, else you just can read. But i don't know how to classify customers after they signed in? If you have any suggestion pls help me!
class Ability
include CanCan::Ability
def initialize(user)
user ||= User.new # guest user (not logged in)
if user.admin?
can :manage, :all
else
can :read, :all
end
end
end