This is the meat of the "unitary executive" legal theory. Under this theory, CBP is just a convenient name for a part of the executive branch. If any part of the executive branch has the right to (or even just isn't prohibited from using) a piece of data, then its just a matter of the president issuing the right orders so that CBP can too. The same would go for getting medical records over to the SEC. Even if he forgets to issue those orders, the Justice department (also part of the executive) obviously won't charge anyone with any kind of crime, and if they did he could pardon them or arrest the judges involved.
I happen to believe that this is all just a convoluted way to back into the fuhrerprinzip by way of originalism, but I have no power.
Either way, the US is not a liberal democracy any more. Laws do not apply to the powerful. Strength and power are the only things that matter. The Enlightment project is dead in Washington (and most statehouses) and the only question of consequence left is: What will replace it?