mirror of
https://github.com/discourse/discourse.git
synced 2025-05-31 20:45:35 +08:00
DEV: Convert min_trust_to_allow_self_wiki to groups (#25009)
We're changing the implementation of trust levels to use groups. Part of this is to have site settings that reference trust levels use groups instead. It converts the min_trust_to_allow_self_wiki site setting to self_wiki_allowed_groups. Nothing of note here. This is used in exactly one place, and there's no fallout.
This commit is contained in:
@ -332,7 +332,7 @@ module PostGuardian
|
||||
return false unless authenticated?
|
||||
return true if is_staff? || @user.has_trust_level?(TrustLevel[4])
|
||||
|
||||
if @user.has_trust_level?(SiteSetting.min_trust_to_allow_self_wiki) && is_my_own?(post)
|
||||
if @user.in_any_groups?(SiteSetting.self_wiki_allowed_groups_map) && is_my_own?(post)
|
||||
return false if post.hidden?
|
||||
return !post.edit_time_limit_expired?(@user)
|
||||
end
|
||||
|
Reference in New Issue
Block a user