Module: CanTango::Api::Scope::User

Includes:
Ability::User
Defined in:
lib/cantango/api/scope/user.rb

Instance Method Summary collapse

Methods included from Ability::User

#current_user_ability, #user_ability

Methods included from Options

#ability_options, options_list, #options_list

Methods included from Common

#category, #create_ability

Instance Method Details

#real_user(scope, options = {}, &block) ⇒ Object



14
15
16
# File 'lib/cantango/api/scope/user.rb', line 14

def real_user scope, options = {}, &block
  scope_user scope, options.merge(:masquerade => false), &block
end

#scope_user(scope, options = {}) {|ab_scope| ... } ⇒ Object Also known as: user_scope

Yields:

  • (ab_scope)


6
7
8
9
10
11
# File 'lib/cantango/api/scope/user.rb', line 6

def scope_user scope, options = {}, &block
  user = scoped_user(scope)
  ab_scope = user_ability_scope(user, options)
  yield ab_scope if block
  ab_scope
end