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.10.2 lib/spree/testing_support/bar_ability.rb
solidus_core-2.9.6 lib/spree/testing_support/bar_ability.rb
solidus_core-2.8.6 lib/spree/testing_support/bar_ability.rb
solidus_core-2.10.1 lib/spree/testing_support/bar_ability.rb
solidus_core-2.9.5 lib/spree/testing_support/bar_ability.rb
solidus_core-2.10.0 lib/spree/testing_support/bar_ability.rb
solidus_core-2.9.4 lib/spree/testing_support/bar_ability.rb
solidus_core-2.6.6 lib/spree/testing_support/bar_ability.rb
solidus_core-2.7.4 lib/spree/testing_support/bar_ability.rb
solidus_core-2.8.5 lib/spree/testing_support/bar_ability.rb
solidus_core-2.9.3 lib/spree/testing_support/bar_ability.rb
solidus_core-2.9.2 lib/spree/testing_support/bar_ability.rb
solidus_core-2.10.0.beta1 lib/spree/testing_support/bar_ability.rb
solidus_core-2.7.3 lib/spree/testing_support/bar_ability.rb
solidus_core-2.6.5 lib/spree/testing_support/bar_ability.rb
solidus_core-2.9.1 lib/spree/testing_support/bar_ability.rb
solidus_core-2.9.0 lib/spree/testing_support/bar_ability.rb
solidus_core-2.9.0.rc.1 lib/spree/testing_support/bar_ability.rb
solidus_core-2.8.4 lib/spree/testing_support/bar_ability.rb
solidus_core-2.8.3 lib/spree/testing_support/bar_ability.rb