Replicating the World Ambient Occlusion setting on a per-shader basis
In simpler cases, AO node + Emission node + Add Shader node seems to do the trick. For instance, World AO with factor 0.1 may be reproduced in a shader as follows:



See also this thread on Blender Artists: thread