mirror of
https://github.com/discourse/discourse.git
synced 2025-05-28 13:39:28 +08:00
Apply embed unlisted setting consistently (#24294)
Applies the embed_unlisted site setting consistently across topic embeds, including those created via the WP Discourse plugin. Relatedly, adds a embed exception to can_create_unlisted_topic? check. Users creating embedded topics are not always staff.
This commit is contained in:
@ -67,7 +67,8 @@ class TopicCreator
|
||||
private
|
||||
|
||||
def validate_visibility(topic)
|
||||
if !@opts[:skip_validations] && !topic.visible && !guardian.can_create_unlisted_topic?(topic)
|
||||
if !@opts[:skip_validations] && !topic.visible &&
|
||||
!guardian.can_create_unlisted_topic?(topic, !!opts[:embed_url])
|
||||
topic.errors.add(:base, :unable_to_unlist)
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user