The United States supreme court dealt a blow to Wall Street whistleblowers on Wednesday when it ruled that protections for them passed by Congress after the 2008 financial crisis only apply to those who report problems to the government, not more broadly, such as to a boss.

The justices decided unanimously that measures in the Dodd-Frank Act that protects whistleblowers from being fired, demoted or harassed only applies to people who report legal violations to the Securities and Exchange Commission, the federal government’s financial watchdog. In a narrow interpretation of the law, they said employees who report problems only to company management don’t qualify.

Reporting internally still affords some protections under an older law, the 2002 Sarbanes-Oxley Act. But the two laws differ in aspects such as how long people have to bring a lawsuit, for example if they have been fired after reporting suspected illegal activity in their company, and how much compensation they can receive.

Two lower federal courts had backed the SEC’s own point of view, that those blowing the whistle internally are protected by Dodd-Frank measures.

The court’s ruling comes at a time when the Trump administration wants to make changes to the 2010 Dodd-Frank Act, which was passed to rein in financial industry excesses that hurt consumers and precipitated a world crisis in 2008. The administration believes the Obama-era legislation has hurt economic growth.

Trump has repeatedly attacked the law as a “disaster” and has promised to do “a big number” on it, although, in reality, major changes would have to go through Congress.

The case that the court ruled on involves Paul Somers, previously a vice-president for San Francisco-based Digital Realty Trust Inc, a real-estate investment trust with international offices. Somers was working in Singapore when he made accusations to senior managers that a boss had hidden millions of dollars in cost overruns and corruptly granted financial favors. Somers sued when he was fired in 2014 and, after losing his case on Wednesday at the supreme court in Washington, his lawyer said Somers had been trying to do the right thing.