Sha256: 6a6d4b4838cfe5474307df5bba9958cff3690ef02ec2dc80f58298cf2aab4e32

Contents?: true

Size: 288 Bytes

Versions: 7

Compression:

Stored size: 288 Bytes

Contents

class Ability
  include CanCan::Ability

  def initialize(user)
    case user.try(:role).try(:name)
    when 'Administrator'
      can [:read, :destroy], ExportFile
    when 'Librarian'
      can [:read, :destroy], ExportFile
    when 'User'
      can :read, ExportFile
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
enju_export-0.1.1.pre2 spec/dummy/app/models/ability.rb
enju_export-0.1.1.pre spec/dummy/app/models/ability.rb
enju_export-0.1.0.pre spec/dummy/app/models/ability.rb
enju_export-0.1.0 spec/dummy/app/models/ability.rb
enju_export-0.0.3 spec/dummy/app/models/ability.rb
enju_export-0.0.2 spec/dummy/app/models/ability.rb
enju_export-0.0.1 spec/dummy/app/models/ability.rb