discourse/app/controllers/admin
Martin Brennan 7c32411881
FEATURE: Secure media allowing duplicated uploads with category-level privacy and post-based access rules (#8664)
### General Changes and Duplication

* We now consider a post `with_secure_media?` if it is in a read-restricted category.
* When uploading we now set an upload's secure status straight away.
* When uploading if `SiteSetting.secure_media` is enabled, we do not check to see if the upload already exists using the `sha1` digest of the upload. The `sha1` column of the upload is filled with a `SecureRandom.hex(20)` value which is the same length as `Upload::SHA1_LENGTH`. The `original_sha1` column is filled with the _real_ sha1 digest of the file. 
* Whether an upload `should_be_secure?` is now determined by whether the `access_control_post` is `with_secure_media?` (if there is no access control post then we leave the secure status as is).
* When serializing the upload, we now cook the URL if the upload is secure. This is so it shows up correctly in the composer preview, because we set secure status on upload.

### Viewing Secure Media

* The secure-media-upload URL will take the post that the upload is attached to into account via `Guardian.can_see?` for access permissions
* If there is no `access_control_post` then we just deliver the media. This should be a rare occurrance and shouldn't cause issues as the `access_control_post` is set when `link_post_uploads` is called via `CookedPostProcessor`

### Removed

We no longer do any of these because we do not reuse uploads by sha1 if secure media is enabled.

* We no longer have a way to prevent cross-posting of a secure upload from a private context to a public context.
* We no longer have to set `secure: false` for uploads when uploading for a theme component.
2020-01-16 13:50:27 +10:00
..
admin_controller.rb DEV: add a few frozen string literals 2019-05-02 16:57:12 +10:00
api_controller.rb FEATURE: Overhaul of admin API key system (#8284) 2019-11-05 14:10:23 +00:00
backups_controller.rb FIX: Prevent scientific notation in free space check (#8473) 2019-12-11 12:57:03 +11:00
badges_controller.rb UX: Return a friendlier error when the CSV is invalid. Added a cancel button to return to the /badges view 2020-01-13 15:53:41 -03:00
color_schemes_controller.rb DEV: add a few frozen string literals 2019-05-02 16:57:12 +10:00
dashboard_controller.rb DEV: add a few frozen string literals 2019-05-02 16:57:12 +10:00
email_controller.rb DEV: Upgrading Discourse to Zeitwerk (#8098) 2019-10-02 14:01:53 +10:00
email_styles_controller.rb FEATURE: customization of html emails (#7934) 2019-07-30 15:05:08 -04:00
email_templates_controller.rb FEATURE: Add welcome message for admins. (#8293) 2019-11-05 18:15:55 +05:30
embeddable_hosts_controller.rb DEV: add a few frozen string literals 2019-05-02 16:57:12 +10:00
embedding_controller.rb DEV: Upgrading Discourse to Zeitwerk (#8098) 2019-10-02 14:01:53 +10:00
emojis_controller.rb DEV: Upgrading Discourse to Zeitwerk (#8098) 2019-10-02 14:01:53 +10:00
groups_controller.rb FEATURE: Publish read state on group messages. (Originally introduced in #7989) (#8025) 2019-08-27 09:09:00 -03:00
impersonate_controller.rb DEV: enable frozen string literal on all files 2019-05-13 09:31:32 +08:00
permalinks_controller.rb DEV: enable frozen string literal on all files 2019-05-13 09:31:32 +08:00
plugins_controller.rb DEV: enable frozen string literal on all files 2019-05-13 09:31:32 +08:00
reports_controller.rb FIX: Don't give error 500 when invalid date param is given to admin reports (#8658) 2020-01-03 17:01:38 +03:00
robots_txt_controller.rb FEATURE: Allow customization of robots.txt (#7884) 2019-07-15 20:47:44 +03:00
screened_emails_controller.rb DEV: enable frozen string literal on all files 2019-05-13 09:31:32 +08:00
screened_ip_addresses_controller.rb DEV: Upgrading Discourse to Zeitwerk (#8098) 2019-10-02 14:01:53 +10:00
screened_urls_controller.rb DEV: enable frozen string literal on all files 2019-05-13 09:31:32 +08:00
search_logs_controller.rb DEV: enable frozen string literal on all files 2019-05-13 09:31:32 +08:00
site_settings_controller.rb REFACTOR: reduce the number of db queries. 2019-11-18 12:06:13 +05:30
site_texts_controller.rb FEATURE: Make site texts controller handle pages and locales (#8408) 2019-11-30 15:16:36 +02:00
staff_action_logs_controller.rb FIX: Don't error when the empty current value in dif (#8406) 2019-11-26 09:17:14 +11:00
themes_controller.rb FEATURE: Secure media allowing duplicated uploads with category-level privacy and post-based access rules (#8664) 2020-01-16 13:50:27 +10:00
user_fields_controller.rb DEV: enable frozen string literal on all files 2019-05-13 09:31:32 +08:00
users_controller.rb FIX: If the admin sso sync has no external ID, don't throw an error 2020-01-08 11:47:37 -05:00
versions_controller.rb DEV: Upgrading Discourse to Zeitwerk (#8098) 2019-10-02 14:01:53 +10:00
watched_words_controller.rb FEATURE: Watched words improvements (#7899) 2019-07-22 14:59:56 +03:00
web_hooks_controller.rb DEV: enable frozen string literal on all files 2019-05-13 09:31:32 +08:00