mirror of
https://github.com/discourse/discourse.git
synced 2025-05-28 13:51:18 +08:00
Add button to delete a spammer in the flag modal
Add SiteSettings: delete_user_max_age, delete_all_posts_max. Add delete spammer button to admin flags UI Moderators can delete users too
This commit is contained in:
@ -151,7 +151,7 @@ class Guardian
|
||||
end
|
||||
|
||||
def can_delete_user?(user)
|
||||
can_administer?(user)
|
||||
user && is_staff? && !user.admin? && user.created_at > SiteSetting.delete_user_max_age.to_i.days.ago
|
||||
end
|
||||
|
||||
# Can we see who acted on a post in a particular way?
|
||||
@ -203,7 +203,7 @@ class Guardian
|
||||
end
|
||||
|
||||
def can_delete_all_posts?(user)
|
||||
is_staff? && user.created_at >= 7.days.ago
|
||||
is_staff? && user && !user.admin? && user.created_at >= 7.days.ago && user.post_count <= SiteSetting.delete_all_posts_max.to_i
|
||||
end
|
||||
|
||||
def can_remove_allowed_users?(topic)
|
||||
|
Reference in New Issue
Block a user