Legally, as the commander in chief, the President is 100% allowed to share any secrets they want with anyone they want. Legally, as part of the powers of the President of the USA.
Whether he should have is another matter.