How to limit rotation without gimbal lock?

So the camera is a component of an actor? And the actor can be in any orientation, but the camera will always move relative to the actor? And you want to limit the Z ( relative to the actor )?

Does that sum it up?