Make a selection. > Hierarchy panel > Link Info button > Locks rollout
The Locks rollout contains controls that prevent transforms along particular axes.
See also
Procedure
To lock all move transforms:
Select an object in the viewports.
In the Locks rollout, turn on Move group > X, Y, and Z.
Only rotate and scale transforms will work.
The object does not need to be part of a hierarchy.
Interface
X, Y, Z: Turn on any axis in the Move, Rotate, or Scale group box to lock the axis. For example, if Rotate > X and Y are turned on, you'll be able to rotate the object only around the Z axis. All locks are relative to an object's local coordinate system.