Constraining joint limits

Is there a possibility to constrain a joint to a particular range of angles. Example - Constrain joint 2 between +/- 45 deg during movement

You can use the Joint Safety Limits to restrict the area of motion allowed for the individual joint.
But this is applicable globally.