mirror of
https://github.com/discourse/discourse.git
synced 2025-06-03 02:48:28 +08:00
New site setting trusted_users_can_edit_others
The default is true to keep with previous discourse behavior. If disabled, high trust level users cannot edit the topics or posts of other users.
This commit is contained in:
@ -46,10 +46,22 @@ module TopicGuardian
|
||||
return false if !can_create_topic_on_category?(topic.category)
|
||||
|
||||
# TL4 users can edit archived topics, but can not edit private messages
|
||||
return true if (topic.archived && !topic.private_message? && user.has_trust_level?(TrustLevel[4]) && can_create_post?(topic))
|
||||
return true if (
|
||||
SiteSetting.trusted_users_can_edit_others? &&
|
||||
topic.archived &&
|
||||
!topic.private_message? &&
|
||||
user.has_trust_level?(TrustLevel[4]) &&
|
||||
can_create_post?(topic)
|
||||
)
|
||||
|
||||
# TL3 users can not edit archived topics and private messages
|
||||
return true if (!topic.archived && !topic.private_message? && user.has_trust_level?(TrustLevel[3]) && can_create_post?(topic))
|
||||
return true if (
|
||||
SiteSetting.trusted_users_can_edit_others? &&
|
||||
!topic.archived &&
|
||||
!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?
|
||||
|
Reference in New Issue
Block a user