When collecting, using, processing, storing and publishing data, researchers must follow legal and ethical guidelines and standards that dictate how they must handle the data:
In order to protect personal privacy, you must obtain consent from the data subject before you process their personal data. If you publish this data, you may need to anonymize them or restrict access to them.
Research projects and their data are protected by copyright. The reuse of this data (including third-party data for your own research project) is subject to copyright law. Educational institutions also have their own requirements as to whether and which data can be published on a repository, for example.
Questions about data privacy and copyright law are specific to individual cases and may sometimes require profound legal assessments. We'll happily advise you on this.