Sha256: 83f13375b534137d5c111a7d13d98510db97bc10fd56c44c123a8d276b4e1d08
Contents?: true
Size: 964 Bytes
Versions: 12
Compression:
Stored size: 964 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, :update], EventCategory can [:destroy, :delete], EventCategory do |event_category| !['unknown', 'closed'].include?(event_category.name) end can :manage, [ Event, EventImportFile, EventExportFile, Participate ] can :read, EventImportResult when 'Librarian' can :manage, [ Event, EventImportFile, EventExportFile, Participate ] can :read, [ EventCategory, EventImportResult ] when 'User' can :read, [ Event, EventCategory ] else can :read, [ Event, EventCategory ] end end end end
Version data entries
12 entries across 12 versions & 1 rubygems