Module: CanTango::Ability::MasqueradeHelpers
- Included in:
- CanTango::Ability
- Defined in:
- lib/cantango/ability/masquerade_helpers.rb
Instance Method Summary collapse
- #masquerade_account? ⇒ Boolean
- #masquerade_user? ⇒ Boolean
- #masquerading? ⇒ Boolean
- #masquerading_off? ⇒ Boolean
Instance Method Details
#masquerade_account? ⇒ Boolean
14 15 16 17 |
# File 'lib/cantango/ability/masquerade_helpers.rb', line 14 def masquerade_account? return false if masquerading_off? candidate.respond_to?(:active_account) end |
#masquerade_user? ⇒ Boolean
5 6 7 8 |
# File 'lib/cantango/ability/masquerade_helpers.rb', line 5 def masquerade_user? return false if masquerading_off? candidate.respond_to?(:active_user) && masquerading? end |
#masquerading? ⇒ Boolean
10 11 12 |
# File 'lib/cantango/ability/masquerade_helpers.rb', line 10 def masquerading? candidate.respond_to?(:masquerading?) && candidate.masquerading? end |
#masquerading_off? ⇒ Boolean
19 20 21 |
# File 'lib/cantango/ability/masquerade_helpers.rb', line 19 def masquerading_off? [:masquerade] == false end |