The Supreme Court just clarified to the Trump administration that — for now — it can ban certain refugees from entering the United States, but it can't ban the grandparents of US residents from visiting.

The Court refused to dispute last week's ruling by a lower court that decided Trump had misinterpreted the higher court's ruling from June, which allowed a limited version of Trump's travel ban to go into effect until the justices hear the case in the fall. It did, however, clarify that grandparents cannot be legally banned under the Supreme Court's ruling. The administration would have to argue that in the lower courts.

This is the latest twist in the Trump's administration's months-long attempt to ban visitors from six Muslim-majority countries from entering the United States.

When the Supreme Court allowed the Trump administration to start enforcing a limited version of its travel ban before considering its constitutionality in the fall, both President Trump and his critics declared victory. Then last week, a federal judge essentially said that the critics had it right and the Trump administration had it wrong.

The Supreme Court’s ruling allowed the Trump administration to ban people from Iran, Libya, Somalia, Sudan, Syria, and Yemen from getting visas to enter the US for 90 days — and prevent nearly all refugees from entering the US for 120 days — unless the visa applicant or refugee had a “bona fide relationship” with someone or something in the US. The Trump administration interpreted “bona fide relationship” pretty narrowly. Those denied included grandparents of US residents, for example, and the administration refused to consider refugees who’d already been assigned to American nonprofits to have a “bona fide” relationship.

Federal Judge Derrick K. Watson said on Thursday night that the administration was misinterpreting the court’s ruling — and told them to fix it. Now the Supreme Court has weighed in to say that Watson's decision was only partially right. It was right in saying that the Supreme Court never intended to keep out the grandparents of legal residents from those countries. However, it was also saying that refugees don't necessarily have a "bona fide" relationship with their US placement agencies, so for now, Trump can keep them from entering the country.

The travel ban for visas had been in effect for two weeks; the ban on refugee admissions was in effect for two days before Watson's ruling. Their scope was already substantially reduced from the original executive order signed by President Trump in January, and even from the modified executive order signed by Trump in March. Now it’s gotten whittled down to a sliver.

Thanks to the Court’s ruling, someone from one of the six blacklisted countries with a grandparent, grandchild, aunt, uncle, niece, nephew, cousin, brother-in-law, or sister-in-law in the US will now be able to apply for a visa to come here before the 90-day ban expires in late September. People with parents, parents-in-law, spouses, fiancés, children (including adult children), sons- and daughters-in-law, siblings, half-siblings, or step-family members in the US were already exempted from the travel ban under the government’s rules.

Perhaps more significantly, though, the Supreme Court's decision reverts to mostly closing the US to refugees. It is essentially saying that having a formal contract with a refugee resettlement agency — nonprofit organizations with which refugees are placed for their first 90 days in the US — does not count as a “bona fide” relationship. Because every refugee who comes to the US has been placed with a resettlement agency, this decision should (in theory) mean that all refugees from those countries are once again barred from entering.

The Supreme Court has pledged to take up the case in the fall.