The ruling comes after years of legal disputes involving Trump and the handling of presidential records.