allow staff to delete user if posts are 5 or less irrespective of delete_user_max_post_age

This commit is contained in:
Arpit Jalan
2018-03-05 10:02:23 +05:30
parent ea812ea05d
commit 003b03d939
4 changed files with 29 additions and 5 deletions

View File

@ -43,7 +43,7 @@ module UserGuardian
if is_me?(user)
user.post_count <= 1
else
is_staff? && (user.first_post_created_at.nil? || user.first_post_created_at > SiteSetting.delete_user_max_post_age.to_i.days.ago)
is_staff? && (user.first_post_created_at.nil? || user.post_count <= 5 || user.first_post_created_at > SiteSetting.delete_user_max_post_age.to_i.days.ago)
end
end