FEATURE: New site setting, whitelisted_link_domains

If provided, users who normally couldn't post links (say, due to a
low trust level), can post links to those specific hosts.
This commit is contained in:
Robin Ward
2018-06-13 14:57:32 -04:00
parent debbb5be16
commit fd54c92a52
10 changed files with 96 additions and 21 deletions

View File

@@ -452,6 +452,13 @@ describe Post do
post_two_links.user.trust_level = TrustLevel[1]
expect(post_one_link).not_to be_valid
end
it "will skip the check for whitelisted domains" do
SiteSetting.whitelisted_link_domains = 'www.bbc.co.uk'
SiteSetting.min_trust_to_post_links = 2
post_two_links.user.trust_level = TrustLevel[1]
expect(post_one_link).to be_valid
end
end
end