mirror of
https://github.com/discourse/discourse.git
synced 2025-05-30 15:28:37 +08:00
FIX: Do not enable published page if secure media enabled (#11131)
There are issues around displaying images on published pages when secure media is enabled. This PR temporarily makes it appear as if published pages are enabled if secure media is also enabled.
This commit is contained in:
@ -3756,6 +3756,20 @@ describe Guardian do
|
||||
post = Fabricate(:private_message_post, user: admin)
|
||||
expect(Guardian.new(admin).can_publish_page?(post.topic)).to eq(false)
|
||||
end
|
||||
|
||||
context "when secure_media is also enabled" do
|
||||
before do
|
||||
setup_s3
|
||||
SiteSetting.secure_media = true
|
||||
end
|
||||
|
||||
it "is false for everyone" do
|
||||
expect(Guardian.new(moderator).can_publish_page?(topic)).to eq(false)
|
||||
expect(Guardian.new(user).can_publish_page?(topic)).to eq(false)
|
||||
expect(Guardian.new.can_publish_page?(topic)).to eq(false)
|
||||
expect(Guardian.new(admin).can_publish_page?(topic)).to eq(false)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user