Amid a vast influx of rural migrants into urban areas, China has allowed cities wide latitude in providing education and other social services. While millions of people have been welcomed into the megacities as a source of cheap labor, local governments have used various tools to limit their access to full citizenship.