mirror of
https://github.com/discourse/discourse.git
synced 2026-09-05 04:40:41 -05:00
FIX: Permission issues when editing topics
If a user can't create a topic in a category, they should'be be able to edit topics.
This commit is contained in:
@@ -29,7 +29,9 @@ module TopicGuardian
|
||||
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 true if is_staff?
|
||||
return true if (!topic.private_message? && user.has_trust_level?(TrustLevel[3]) && can_create_post?(topic))
|
||||
|
||||
return false if topic.archived
|
||||
is_my_own?(topic) && !topic.edit_time_limit_expired?
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user