mirror of
https://github.com/discourse/discourse.git
synced 2025-05-23 11:41:03 +08:00
FEATURE: Secure uploads in PMs only (#23398)
This adds a new secure_uploads_pm_only site setting. When secure_uploads is true with this setting, only uploads created in PMs will be marked secure; no uploads in secure categories will be marked as secure, and the login_required site setting has no bearing on upload security either. This is meant to be a stopgap solution to prevent secure uploads in a single place (private messages) for sensitive admin data exports. Ideally we would want a more comprehensive way of saying that certain upload types get secured which is a hybrid/mixed mode secure uploads, but for now this will do the trick.
This commit is contained in:
@ -28,6 +28,14 @@ RSpec.describe UploadSecurity do
|
||||
expect(security.should_be_secure?).to eq(true)
|
||||
end
|
||||
|
||||
context "if secure_uploads_pm_only" do
|
||||
before { SiteSetting.secure_uploads_pm_only = true }
|
||||
|
||||
it "returns false" do
|
||||
expect(security.should_be_secure?).to eq(false)
|
||||
end
|
||||
end
|
||||
|
||||
context "when uploading in public context" do
|
||||
describe "for a public type badge_image" do
|
||||
let(:type) { "badge_image" }
|
||||
|
Reference in New Issue
Block a user