Class: DataMigrationUserPolicy::Scope

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

Instance Method Summary collapse

Instance Method Details

#resolveObject



29
30
31
32
33
34
35
# File 'app/policies/data_migration_user_policy.rb', line 29

def resolve
  if user.can_manage_users?
    scope.all # Admins see all users
  else
    scope.where(id: user.id) # Others only see themselves
  end
end