Merge pull request #3239 from riking/edit-perms

FIX: TL3 could retitle restricted topics
This commit is contained in:
Sam 2015-02-27 08:38:10 +11:00
commit 5cab84b4b2

View File

@ -28,6 +28,7 @@ module TopicGuardian
# Editing Method
def can_edit_topic?(topic)
return false if Discourse.static_doc_topic_ids.include?(topic.id) && !is_admin?
return false unless can_see?(topic)
return true if is_staff? || (!topic.private_message? && user.has_trust_level?(TrustLevel[3]))
return false if topic.archived
is_my_own?(topic) && !topic.edit_time_limit_expired?