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

Defined in:
lib/cantango/api/user/scope.rb

Instance Method Summary collapse

Instance Method Details

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



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

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

#scope_user(scope, options = {}) {|ab_scope| ... } ⇒ Object

Yields:

  • (ab_scope)


6
7
8
9
10
11
# File 'lib/cantango/api/user/scope.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