(Reuters) - The U.S. Supreme Court on Tuesday put new restrictions on presidential powers, limiting a president’s authority to staff certain top government posts in a case involving an appointment to the National Labor Relations Board.

The U.S. Supreme Court building seen in Washington May 20, 2009. REUTERS/Molly Riley

The court decided 6-2 to uphold a lower court’s ruling that then-President Barack Obama exceeded his legal authority with his temporary appointment of an NLRB general counsel in 2011.

In an opinion by Chief Justice John Roberts, the court said that under the Federal Vacancies Reform Act, a person cannot serve as the acting head of a federal agency once the president nominates him or her to permanently serve in the role if it is a position that requires U.S. Senate confirmation.

SW General Inc, a Scottsdale, Arizona-based private ambulance company and a subsidiary of Envision Healthcare Holdings Inc EVHC.N, had challenged the makeup of the NLRB as it sought to invalidate a board ruling that said it violated federal labor law by discontinuing bonus payments for longtime employees.

The NLRB had argued that the law’s restriction applied only to politically appointed “first assistants” who are first in line for acting positions when the heads of agencies leave office, and not to other officials.

The ruling will give President Donald Trump and future presidents less flexibility in filling jobs that require Senate confirmation.

Justices Sonia Sotomayor and Ruth Bader Ginsburg dissented, saying the court ignored the fact that since the law governing vacancies was adopted in 1998, more than 100 people have served in acting roles while the U.S. Senate considered their nominations for permanent jobs.

The case focused on Obama’s appointment of Lafe Solomon as the NLRB’s acting general counsel to fill a vacancy in the job. The position requires Senate confirmation.

Obama nominated Solomon to fill the position permanently but also named him to fill in for former general counsel Ronald Meisburg, who resigned in 2010, in the interim while awaiting Senate action. Obama eventually withdrew Solomon’s nomination after it stalled for more than two years. The Senate ultimately confirmed Richard Griffin to the post in 2013.

SW General argued that Solomon should not have continued to fill the position on a temporary basis pending Senate confirmation, and the Supreme Court on Tuesday agreed.

The case is National Labor Relations Board v. SW General Inc, U.S. Supreme Court No. 15–1251.