Sha256: eefb857ba9a5a0d1b067567fc7a791c16ddc4be0a6b991b90d315210acf0bd93
Contents?: true
Size: 784 Bytes
Versions: 46
Compression:
Stored size: 784 Bytes
Contents
class Ability include CanCan::Ability def initialize(user) case user.try(:role).try(:name) when 'Administrator' can [:read, :create], EventCategory can [:update, :destroy], EventCategory do |event_category| !['unknown', 'closed'].include?(event_category.name) end can :manage, [ Event, EventImportFile, Participate ] can :read, EventImportResult when 'Librarian' can :manage, [ Event, EventImportFile, Participate ] can :read, [ EventCategory, EventImportResult ] when 'User' can :read, [ Event, EventCategory ] else can :read, [ Event, EventCategory ] end end end
Version data entries
46 entries across 46 versions & 1 rubygems