mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: do not allow creation of topic if there is no category available for posting (#7786)
This commit is contained in:
@@ -39,7 +39,8 @@ module TopicGuardian
|
||||
is_staff? ||
|
||||
(user &&
|
||||
user.trust_level >= SiteSetting.min_trust_to_create_topic.to_i &&
|
||||
can_create_post?(parent))
|
||||
can_create_post?(parent) &&
|
||||
Category.topic_create_allowed(self).limit(1).count == 1)
|
||||
end
|
||||
|
||||
def can_create_topic_on_category?(category)
|
||||
|
||||
Reference in New Issue
Block a user