When the Communists took over in 1949 China's society was reorganized into work units: walled complexes where people lived and worked. This system is often referred to as the iron rice bowl because everything one needed in life from the moment he was born until he died was provided for free by the state. There was no unemployment. Housing, education, health care were free.
Everything changed after 1978 when the Reform was introduced, but even in today's China the work unit continuous to exists to a certain extent. Work units have gates and gate keepers to keep control over who is going in and out. Although the factories and organizations inside the infrastructure of the former work unit now have to take care of their own management, the gate keeper system is still used.