DEV: Convert min_trust_level_to_allow_ignore to groups (#24894)

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_level_to_allow_ignore  site setting to ignore_allowed_groups.

This PR maintains backwards compatibility until we can update plugins and themes using this.
This commit is contained in:
Ted Johansson
2023-12-18 13:04:37 +08:00
committed by GitHub
parent 6ab1a19e93
commit 0edf39409c
8 changed files with 62 additions and 9 deletions

View File

@ -557,7 +557,8 @@ class Guardian
def can_ignore_users?
return false if anonymous?
@user.staff? || @user.has_trust_level?(SiteSetting.min_trust_level_to_allow_ignore.to_i)
@user.staff? || @user.has_trust_level?(SiteSetting.min_trust_level_to_allow_ignore.to_i) ||
@user.in_any_groups?(SiteSetting.ignore_allowed_groups_map)
end
def allowed_theme_repo_import?(repo)