mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: Allow category moderators to move topics to their categories (#20896)
This commit is contained in:
@@ -73,4 +73,13 @@ module CategoryGuardian
|
||||
@topic_featured_link_allowed_category_ids =
|
||||
Category.where(topic_featured_link_allowed: true).pluck(:id)
|
||||
end
|
||||
|
||||
def topics_need_approval?(category)
|
||||
return false if is_admin?
|
||||
return category.require_topic_approval? if !SiteSetting.enable_category_group_moderation
|
||||
return category.require_topic_approval? if category.reviewable_by_group_id.nil?
|
||||
if category.reviewable_by_group_id
|
||||
!self.user.belonging_to_group_ids.include?(category.reviewable_by_group_id)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -70,8 +70,7 @@ module TopicGuardian
|
||||
Category.find(category || SiteSetting.uncategorized_category_id)
|
||||
end
|
||||
)
|
||||
|
||||
is_staff? || (can_create_topic_on_category?(category) && !category.require_topic_approval?)
|
||||
is_staff? || can_create_topic_on_category?(category) && !topics_need_approval?(category)
|
||||
end
|
||||
|
||||
def can_create_post_on_topic?(topic)
|
||||
|
||||
Reference in New Issue
Block a user