mirror of
https://github.com/discourse/discourse.git
synced 2025-09-06 10:50:21 +08:00
Add ability to destroy a user with 0 posts
This commit is contained in:
parent
8014d7fd25
commit
651cfba93f
21 changed files with 412 additions and 57 deletions
|
@ -148,6 +148,13 @@ class Guardian
|
|||
true
|
||||
end
|
||||
|
||||
def can_delete_user?(user_to_delete)
|
||||
return false unless @user.try(:admin?)
|
||||
return false if user_to_delete.blank?
|
||||
return false if user_to_delete.post_count > 0
|
||||
true
|
||||
end
|
||||
|
||||
# Can we see who acted on a post in a particular way?
|
||||
def can_see_post_actors?(topic, post_action_type_id)
|
||||
return false unless topic.present?
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue