DEV: Move min_trust_level_for_here_mention to group setting (#24263)

c.f. https://meta.discourse.org/t/-/283408
This commit is contained in:
Martin Brennan
2023-11-09 12:07:01 +10:00
committed by GitHub
parent 37fda6d479
commit 67ac4c5616
6 changed files with 59 additions and 1 deletions

View File

@@ -607,7 +607,8 @@ class Guardian
return false if !authenticated?
return false if User.where(username_lower: SiteSetting.here_mention).exists?
@user.has_trust_level_or_staff?(SiteSetting.min_trust_level_for_here_mention)
@user.in_any_groups?(SiteSetting.here_mention_allowed_groups_map) ||
@user.has_trust_level_or_staff?(SiteSetting.min_trust_level_for_here_mention)
end
def is_me?(other)

View File

@@ -10,6 +10,7 @@ module SiteSettings::DeprecatedSettings
["default_categories_regular", "default_categories_normal", true, "3.0"],
["anonymous_posting_min_trust_level", "anonymous_posting_allowed_groups", false, "3.3"],
["shared_drafts_min_trust_level", "shared_drafts_allowed_groups", false, "3.3"],
["min_trust_level_for_here_mention", "here_mention_allowed_groups", false, "3.3"],
]
def setup_deprecated_methods