Civil servants who are not invited to Christmas parties by their colleagues have been advised that they could bring legal claims for discrimination.