incapaz
(sjr04)
May 16, 2021, 5:01pm
1
Something I have always found interesting was why the ignore feature is only available to TL2+ rather than for everyone or a configurable setting to allow users by trust level.
def can_mute_users?
return false if anonymous?
@user.staff? || @user.trust_level >= TrustLevel.levels[:basic]
end
def can_ignore_user?(target_user)
can_ignore_users? && @user.id != target_user.id && !target_user.staff?
end
def can_ignore_users?
return false if anonymous?
@user.staff? || @user.trust_level >= TrustLevel.levels[:member]
end
def allow_themes?(theme_ids, include_preview: false)
return true if theme_ids.blank?
if include_preview && is_staff? && (theme_ids - Theme.theme_ids).blank?
return true
end
As well, muting is hard coded to TL1+? Mostly curious about the ux thought process here
1 Like
hawm
(Hawm)
May 16, 2021, 5:30pm
3
If you watch the master branch, it has been changed.
def can_mute_users?
return false if anonymous?
@user.staff? || @user.trust_level >= TrustLevel.levels[:basic]
end
def can_ignore_user?(target_user)
can_ignore_users? && @user.id != target_user.id && !target_user.staff?
end
def can_ignore_users?
return false if anonymous?
@user.staff? || @user.has_trust_level?(SiteSetting.min_trust_level_to_allow_ignore.to_i)
end
def allowed_theme_repo_import?(repo)
return false if !@user.admin?
allowed_repos = GlobalSetting.allowed_theme_repos
if !allowed_repos.blank?
urls = allowed_repos.split(",").map(&:strip)
5 Likes