Class: Ability

Inherits:
Object
  • Object
show all
Includes:
ArtfullyOse::CommonAbilities, CanCan::Ability
Defined in:
app/models/ability.rb

Instance Method Summary collapse

Methods included from ArtfullyOse::CommonAbilities

#default_abilities_for, #import_ablilities_for, #order_ablilities_for, #paid_ticketing_abilities_for, #person_abilities_for, #ticketing_abilities_for

Constructor Details

#initialize(user) ⇒ Ability

Returns a new instance of Ability.



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

def initialize(user)
  user ||= User.new
  ticketing_abilities_for(user) if user.is_in_organization?
  paid_ticketing_abilities_for(user) if user.current_organization.can? :access, :paid_ticketing
  person_abilities_for(user) if user.is_in_organization?
  order_ablilities_for(user) if user.is_in_organization?
  import_ablilities_for(user) if user.is_in_organization?
  default_abilities_for(user)
end