Constraint joint limits during movement

I am using UR5e model.

Is there a way to constraint joint limits during movement. If I set the robot to move from one point to another with a constraint saying wrist 1 can move only +/- 45 deg from the current pose, will the system be able to solve inverse kinematics solution (joint space) or forward kinematics (cartesian space)?.
Can somebody give me an idea of how to approach this scenario?