The decision could affect how Europe handles migrants at its borders.