mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FEATURE: allow admin to delete all posts by a user irrespectively (#14128)
This commit allows admin to delete all posts by a user irrespective of site settings `delete_user_max_post_age` and `delete_all_posts_max`.
This commit is contained in:
@@ -100,8 +100,9 @@ module PostGuardian
|
||||
is_staff? &&
|
||||
user &&
|
||||
!user.admin? &&
|
||||
(user.first_post_created_at.nil? || user.first_post_created_at >= SiteSetting.delete_user_max_post_age.days.ago) &&
|
||||
user.post_count <= SiteSetting.delete_all_posts_max.to_i
|
||||
(is_admin? ||
|
||||
((user.first_post_created_at.nil? || user.first_post_created_at >= SiteSetting.delete_user_max_post_age.days.ago) &&
|
||||
user.post_count <= SiteSetting.delete_all_posts_max.to_i))
|
||||
end
|
||||
|
||||
def can_create_post?(parent)
|
||||
|
||||
Reference in New Issue
Block a user