The Consumer Financial Protection Bureau’s top lawyer wrote in a legal opinion on Saturday that President Donald Trump had the authority to name the interim director for the bureau upon the resignation of Richard Cordray, Politico reported Sunday night.

“It is my legal opinion that the president possesses the authority to designate an acting director for the bureau,” Mary McLeod, the top lawyer at the CFPB, wrote in the Nov. 25 memo obtained by Politico. “I advise all bureau personnel to act consistently with the understanding that Director Mulvaney is the acting director of the CFPB.”

Despite the legal opinion issued in favor of Trump, the CFPB’s deputy director, who was named by outgoing director Richard Cordray as the interim bureau chief, sued the Trump administration on Sunday.

Upon Cordray’s resignation, Trump named Mick Mulvaney, the director of the Office of Management and Budget, the interim director of the bureau. However, Cordray chose the bureau’s deputy director, Leandra English, to serve as director until the Senate approves a permanent bureau chief.

In a lawsuit filed in the U.S. District Court for the District of Columbia Sunday, English argued that the Dodd-Frank Act allows her to take over as interim director.

In a statement to Politico, White House Press Secretary Sarah Huckabee Sanders said that McLeod’s legal opinion shows Trump has the authority to name an interim director.

“Now that the CFPB’s own General Counsel – who was hired under Richard Cordray – has notified the Bureau’s leadership that she agrees with the Administration’s and DOJ’s reading of the law, there should be no question that Director Mulvaney is the Acting Director,” Sanders said. “It is unfortunate that Mr. Cordray decided to put his political ambition above the interests of consumers with this stunt.”