Completed function to assign users to shifts.