FIX: Don't allow users to edit topic information when the OP is locked

see:
https://meta.discourse.org/t/user-able-to-edit-title-of-locked-post/104826
This commit is contained in:
Robin Ward
2019-06-18 14:22:38 -04:00
parent 6fec4982d9
commit e8b9f38374
2 changed files with 13 additions and 1 deletions

View File

@@ -97,7 +97,9 @@ module TopicGuardian
)
return false if topic.archived
is_my_own?(topic) && !topic.edit_time_limit_expired?
is_my_own?(topic) &&
!topic.edit_time_limit_expired? &&
!Post.where(topic_id: topic.id, post_number: 1).where.not(locked_by_id: nil).exists?
end
# Recovery Method