Court of Appeal rules on immigration rights