Class: BarAbility
- Inherits:
-
Object
- Object
- BarAbility
- Includes:
- CanCan::Ability
- Defined in:
- lib/spree/core/testing_support/bar_ability.rb
Overview
Fake ability for testing administration
Instance Method Summary collapse
-
#initialize(user) ⇒ BarAbility
constructor
A new instance of BarAbility.
Constructor Details
#initialize(user) ⇒ BarAbility
Returns a new instance of BarAbility.
5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/spree/core/testing_support/bar_ability.rb', line 5 def initialize(user) user ||= Spree::User.new if user.has_spree_role? 'bar' # allow dispatch to :index and :show orders on the admin can :index, Spree::Order can :show, Spree::Order can :admin, Spree::Order # allow dispatch to :index, :show, :create and :update shipments on the admin can :manage, Spree::Shipment can :admin, Spree::Shipment end end |