Three data subjects' rights contain exemptions in favour of the public interest:
Art. 18 II: “Where processing has been restricted under paragraph 1, such personal data shall […] only be processed […] for reasons of important public interest of the Union or of a Member State.”
Art. 20 III 2: “That right [data portability] shall not apply to processing necessary for the performance of a task carried out in the public interest or in the exercise of official authority vested in the controller.”
Art. 21 VI: “Where personal data are processed for scientific or historical research purposes or statistical purposes […], the data subject, […] shall have the right to object to processing of personal data concerning him or her, unless the processing is necessary for the performance of a task carried out for reasons of public interest.”
Further public interest exemptions may be laid down in Union or Member State law (Art. 23 GDPR).