mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: Guardian#can_remove_allowed_users? shouldn't break for ownerless topics
A topic can outlive its original author. TopicGuardian should still work in this situation.
This commit is contained in:
@@ -5,7 +5,7 @@ module TopicGuardian
|
||||
|
||||
def can_remove_allowed_users?(topic, target_user = nil)
|
||||
is_staff? ||
|
||||
(topic.user == user && user.has_trust_level?(TrustLevel[2])) ||
|
||||
(topic.user == @user && @user.has_trust_level?(TrustLevel[2])) ||
|
||||
(
|
||||
topic.allowed_users.count > 1 &&
|
||||
topic.user != target_user &&
|
||||
|
||||
Reference in New Issue
Block a user