Sha256: 20c5181d33f5ab99be4932092b6b29c0f504098a2d268f4e0b359d7fbf8890e0
Contents?: true
Size: 912 Bytes
Versions: 23
Compression:
Stored size: 912 Bytes
Contents
#module EnjuEvent class Ability include CanCan::Ability def initialize(user, ip_address = nil) case user.try(:role).try(:name) when 'Administrator' can [:read, :create], EventCategory can [:update, :destroy, :delete], 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 #end
Version data entries
23 entries across 23 versions & 1 rubygems