Commit Graph

22 Commits

Author SHA1 Message Date
7fc8d74f3e FEATURE: Allow admins to export users (#30918)
The GDPR requires all users to be able to export their data, or request an export of their data. This is fine for active users as we have a data export button on user profiles, but suspended users have no way of accessing the data export function, and the workaround for admins to export data for suspended users involves temporarily unsuspending them, then impersonating the user to export the data as them.

Since suspended users no longer have access to their account, we can safely assume that the export request will be coming via a medium outside of Discourse (eg, email). This change is built with this workflow in mind.

This change adds a new "User exports" section to the admin user page, allowing admins to start a new export, and to download the latest export file.
2025-01-24 08:13:25 +11:00
5a003715d3 DEV: Apply syntax_tree formatting to app/* 2023-01-09 14:14:59 +00:00
9db8f00b3d FEATURE: Create upload_references table (#16146)
This table holds associations between uploads and other models. This can be used to prevent removing uploads that are still in use.

* DEV: Create upload_references
* DEV: Use UploadReference instead of PostUpload
* DEV: Use UploadReference for SiteSetting
* DEV: Use UploadReference for Badge
* DEV: Use UploadReference for Category
* DEV: Use UploadReference for CustomEmoji
* DEV: Use UploadReference for Group
* DEV: Use UploadReference for ThemeField
* DEV: Use UploadReference for ThemeSetting
* DEV: Use UploadReference for User
* DEV: Use UploadReference for UserAvatar
* DEV: Use UploadReference for UserExport
* DEV: Use UploadReference for UserProfile
* DEV: Add method to extract uploads from raw text
* DEV: Use UploadReference for Draft
* DEV: Use UploadReference for ReviewableQueuedPost
* DEV: Use UploadReference for UserProfile's bio_raw
* DEV: Do not copy user uploads to upload references
* DEV: Copy post uploads again after deploy
* DEV: Use created_at and updated_at from uploads table
* FIX: Check if upload site setting is empty
* DEV: Copy user uploads to upload references
* DEV: Make upload extraction less strict
2022-06-09 09:24:30 +10:00
2ba4de2d45 REVERT: DEV: should ignore missing post uploads when a user export destroyed
Reverts 793915fe6aa1024b6a08cb8b042b7fb1e0bbece8. We no longer need this since we're destroying each posts in commit 028121b95b982500e0c63b11d216a6162d47a7bb.
2019-07-25 19:41:25 +05:30
f54a865846 DEV: refactor cleaning up of user export topics 2019-05-30 10:24:45 +05:30
028121b95b FIX: delete system generated message when user_export record is deleted (#7595)
FIX: system generated message for user export should be closed by default
2019-05-28 16:38:41 +05:30
793915fe6a DEV: should ignore missing post uploads when a user export destroyed 2019-05-21 13:32:36 +05:30
30990006a9 DEV: enable frozen string literal on all files
This reduces chances of errors where consumers of strings mutate inputs
and reduces memory usage of the app.

Test suite passes now, but there may be some stuff left, so we will run
a few sites on a branch prior to merging
2019-05-13 09:31:32 +08:00
7b194743d7 FIX: clean up user export csv upload records in scheduled job (#7309) 2019-04-03 13:31:19 +05:30
95f263995d FIX: Previous annotations were broken 2019-01-11 14:30:19 -05:00
a3839495e0 Update annotations 2019-01-11 12:19:43 -05:00
d600e71b3d FIX: Clean up stale UserExport records daily.
* Add tests for `UserExport.remove_old_exports`
2018-06-05 09:43:40 +08:00
91bf10bd12 FIX: create upload record for exported csv files 2018-04-20 00:27:49 +05:30
226ace1643 Update annotations. 2018-02-20 14:28:58 +08:00
daeb7694bc update annotations 2017-12-05 21:03:20 +05:30
Sam
c68999e128 annotate models
WARNING annotators out there, be to run bin/annotate on RAILS_ENV=test on a clean db
2017-08-16 10:38:11 -04:00
86d50d0017 PERF: stream CSV exports so they don't fail when they are too big 2016-05-25 22:20:35 +02:00
Sam
32c681c96b annotate models 2016-02-23 10:33:53 +11:00
Sam
21402d9d9e annotations 2015-02-04 16:34:25 +11:00
c619aed8f9 💄 add username and date-time in exported file name 2015-01-16 01:39:46 +05:30
c4da9ce62f FIX: old csv's were not getting deleted 2015-01-15 00:00:39 +05:30
68e66f3a25 Rename CsvExportLog to UserExport 2014-12-28 22:31:12 +05:30