Method: BarAbility#initialize
- Defined in:
- lib/spree/testing_support/bar_ability.rb
#initialize(user) ⇒ BarAbility
Returns a new instance of BarAbility.
5 6 7 8 9 10 11 12 13 |
# File 'lib/spree/testing_support/bar_ability.rb', line 5 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 |