Sha256: ed271958a8136062a79c4fabd7abfa77e29ef6e55c765502fc989bd8258c8d78

Contents?: true

Size: 562 Bytes

Versions: 66

Compression:

Stored size: 562 Bytes

Contents

# frozen_string_literal: true

Spree::Deprecation.warn "BarAbility is deprecated. Use stub_authorization! instead"

# Fake ability for testing administration
# @private
class BarAbility
  include CanCan::Ability

  def initialize(user)
    user ||= Spree::User.new
    if user.has_spree_role? 'bar'
      # allow dispatch to :admin, :index, and :show on Spree::Order
      can [:admin, :index, :show], Spree::Order
      # allow dispatch to :index, :show, :create and :update shipments on the admin
      can [:admin, :manage], Spree::Shipment
    end
  end
end

Version data entries

66 entries across 66 versions & 2 rubygems

Version Path
solidus_core-2.11.17 lib/spree/testing_support/bar_ability.rb
solidus_core-2.11.16 lib/spree/testing_support/bar_ability.rb
solidus_core-2.11.15 lib/spree/testing_support/bar_ability.rb
solidus_core-2.11.14 lib/spree/testing_support/bar_ability.rb
solidus_core-2.11.13 lib/spree/testing_support/bar_ability.rb
solidus_core-2.11.12 lib/spree/testing_support/bar_ability.rb
solidus_core-2.11.11 lib/spree/testing_support/bar_ability.rb
solidus_core-2.10.5 lib/spree/testing_support/bar_ability.rb
solidus_core-2.11.10 lib/spree/testing_support/bar_ability.rb
solidus_core-2.11.9 lib/spree/testing_support/bar_ability.rb
solidus_core-2.11.8 lib/spree/testing_support/bar_ability.rb
solidus_core-2.11.7 lib/spree/testing_support/bar_ability.rb
solidus_core-2.11.6 lib/spree/testing_support/bar_ability.rb
solidus_core-2.11.5 lib/spree/testing_support/bar_ability.rb
solidus_core-2.11.4 lib/spree/testing_support/bar_ability.rb
solidus_core-2.11.3 lib/spree/testing_support/bar_ability.rb
solidus_core-2.11.2 lib/spree/testing_support/bar_ability.rb
solidus_core-2.11.1 lib/spree/testing_support/bar_ability.rb
solidus_core-2.10.3 lib/spree/testing_support/bar_ability.rb
solidus_core-2.11.0 lib/spree/testing_support/bar_ability.rb