Class: CustomerPortalAbility

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

Overview

Authorization rules for the customer-facing WWW portal.
Loaded by BasePortalController via current_ability; never evaluated for
CRM (employee) sessions.

Party may be a Customer or Contact. Each has its own set of private methods.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(party) ⇒ CustomerPortalAbility

Returns a new instance of CustomerPortalAbility.



13
14
15
16
17
18
19
20
21
22
# File 'app/models/customer_portal_ability.rb', line 13

def initialize(party)
  @party   = party
  @account = party&.
  return unless 

  case party
  when Customer then define_customer_abilities
  when Contact  then define_contact_abilities
  end
end

Instance Attribute Details

#accountObject (readonly)

Returns the value of attribute account.



11
12
13
# File 'app/models/customer_portal_ability.rb', line 11

def 
  @account
end

#partyObject (readonly)

Returns the value of attribute party.



11
12
13
# File 'app/models/customer_portal_ability.rb', line 11

def party
  @party
end