Class: CustomerPortalAbility
- Inherits:
-
Object
- Object
- CustomerPortalAbility
- 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
-
#account ⇒ Object
readonly
Returns the value of attribute account.
-
#party ⇒ Object
readonly
Returns the value of attribute party.
Instance Method Summary collapse
-
#initialize(party) ⇒ CustomerPortalAbility
constructor
A new instance of CustomerPortalAbility.
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&.account return unless account case party when Customer then define_customer_abilities when Contact then define_contact_abilities end end |
Instance Attribute Details
#account ⇒ Object (readonly)
Returns the value of attribute account.
11 12 13 |
# File 'app/models/customer_portal_ability.rb', line 11 def account @account end |
#party ⇒ Object (readonly)
Returns the value of attribute party.
11 12 13 |
# File 'app/models/customer_portal_ability.rb', line 11 def party @party end |