Sha256: 62e0d423701a2e7f5fefa1fff03afe3cb36b3f915f789627247e3be1893c408f

Contents?: true

Size: 381 Bytes

Versions: 10

Compression:

Stored size: 381 Bytes

Contents

module EnjuInventory
  class Ability
    include CanCan::Ability

    def initialize(user, ip_address = nil)
      case user.try(:role).try(:name)
      when 'Administrator'
        can :manage, [
          Inventory,
          InventoryFile
        ]
      when 'Librarian'
        can :manage, [
          Inventory,
          InventoryFile
        ]
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
enju_inventory-0.1.12 app/models/enju_inventory/ability.rb
enju_inventory-0.1.11 app/models/enju_inventory/ability.rb
enju_inventory-0.1.11.pre13 app/models/enju_inventory/ability.rb
enju_inventory-0.1.11.pre12 app/models/enju_inventory/ability.rb
enju_inventory-0.1.11.pre11 app/models/enju_inventory/ability.rb
enju_inventory-0.1.11.pre10 app/models/enju_inventory/ability.rb
enju_inventory-0.1.11.pre9 app/models/enju_inventory/ability.rb
enju_inventory-0.1.11.pre8 app/models/enju_inventory/ability.rb
enju_inventory-0.1.11.pre7 app/models/enju_inventory/ability.rb
enju_inventory-0.1.11.pre6 app/models/enju_inventory/ability.rb