I bet that wouldn't be legal for a private company to do.
Sure is.
They're called labor lawyers, and along with other HR type consultants, they're engaged every day.