Can I access a mesh's local vertex positions in Cycles Nodes?
You can easily use use the Object texture coordinates from the Texture Coordinates node to achieve this.

The socket will output XYZ values in object space, than can be used as RGB values or mapped with a Color Ramp node.

All you have to do is use a Separate XYZ node to get the Z component of the coordinates, and optionally a Math node set to Absolute so you can easily have symmetry along Z, if that is what you wish to achieve.

 

Taking this a step further, you can calculate the distance as sqrt(x^2 + y^2 + z^2) (and remove the Absolute node) as follows :



Feed this into a 'Multiply' Math node to allow you to scale it as necessary and link this into the Color Ramp.