Class: SpreeCmCommissioner::CheckInAbility

Inherits:
Object
  • Object
show all
Includes:
CanCan::Ability
Defined in:
app/models/spree_cm_commissioner/check_in_ability.rb

Instance Method Summary collapse

Constructor Details

#initialize(user) ⇒ CheckInAbility

Returns a new instance of CheckInAbility.



5
6
7
8
9
10
11
12
13
14
# File 'app/models/spree_cm_commissioner/check_in_ability.rb', line 5

def initialize(user)
  if user.has_spree_role?('operator')
    can :manage, CheckIn
  elsif user.has_spree_role?('organizer')
    can :manage, CheckIn
    can :manage, Guest
  else
    cannot :manage, CheckIn
  end
end