Refactored proposal. Enabled cancancan

This commit is contained in:
Henne Vogelsang 2014-07-23 16:24:05 +02:00
parent 0ae7991943
commit c982cbb88a
13 changed files with 204 additions and 231 deletions

View file

@ -1,17 +0,0 @@
class AdminAbility
include CanCan::Ability
def initialize(user)
@user = user || User.new # for guest
@user.get_roles.each { |role| send(role.name.downcase) }
end
def organizer
can :manage, Event
end
def admin
organizer
can :manage, :all
end
end