FIX: Admins not able to convert topics if they aren't in personal_message_enabled_groups (#23399)

Admins are always able to send PMs, so it doesn't make
sense that they shouldn't be able to convert topics just
because they aren't in personal_message_enabled_groups.
This commit is contained in:
Martin Brennan
2023-09-06 09:17:40 +10:00
committed by GitHub
parent 152a99b3f4
commit de9b567c19
2 changed files with 6 additions and 1 deletions

View File

@@ -201,11 +201,11 @@ module TopicGuardian
alias can_create_unlisted_topic? can_toggle_topic_visibility?
def can_convert_topic?(topic)
return false unless @user.in_any_groups?(SiteSetting.personal_message_enabled_groups_map)
return false if topic.blank?
return false if topic.trashed?
return false if topic.is_category_topic?
return true if is_admin?
return false if !@user.in_any_groups?(SiteSetting.personal_message_enabled_groups_map)
is_moderator? && can_create_post?(topic)
end