FEATURE: Allow admins to disable self-service account deletion

https://meta.discourse.org/t/-/146276
This commit is contained in:
Kane York
2020-04-01 13:10:17 -07:00
committed by Kane York
parent 90fcede832
commit cdaa60b56b
5 changed files with 30 additions and 2 deletions

View File

@ -62,7 +62,7 @@ module UserGuardian
return false if user.nil? || user.admin?
if is_me?(user)
!SiteSetting.enable_sso &&
!user.has_more_posts_than?(User::MAX_SELF_DELETE_POST_COUNT)
!user.has_more_posts_than?(SiteSetting.delete_user_self_max_post_count)
else
is_staff? && (
user.first_post_created_at.nil? ||