Class: OrganizationAbility

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

Instance Method Summary collapse

Constructor Details

#initialize(organization) ⇒ OrganizationAbility

Returns a new instance of OrganizationAbility.



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'app/models/organization_ability.rb', line 4

def initialize(organization)
  organization.kits.each do |kit|
    kit.abilities.arity < 1 ? instance_eval(&kit.abilities) : kit.abilities.call(self)
  end

  can :manage, Event, :organization_id => organization.id
  can :manage, Show, :organization_id => organization.id
  can :manage, Chart, :organization_id => organization.id
  can :manage, Ticket, :organization_id => organization.id
  can :manage, Person, :organization_id => organization.id
  can :manage, Segment, :organization_id => organization.id
  can :manage, Order, :organization_id => organization.id
  can :manage, Household, :organization_id => organization.id

  can :manage, Organization, :id => organization.id
end