Class: Oxen::AccountPolicy::Scope

Inherits:
Scope
  • Object
show all
Defined in:
app/policies/oxen/account_policy.rb

Instance Method Summary collapse

Instance Method Details

#resolveObject



5
6
7
8
9
10
11
12
13
# File 'app/policies/oxen/account_policy.rb', line 5

def resolve
  if current_user.nil?
    super
  elsif current_user.admin?
    scope.all
  else
    scope.where(id: current_user..id)
  end
end