tap/app/models/ability.rb

14 lines
236 B
Ruby
Raw Normal View History

2014-12-09 18:44:58 +00:00
class Ability
include CanCan::Ability
def initialize(user)
user ||= User.new # guest user (not logged in)
if user.admin?
can :manage, :all
2014-12-15 18:43:02 +00:00
can :schulden, :admins
2014-12-09 18:44:58 +00:00
else
can :read, :all
end
end
end