Add ability to destroy a user with 0 posts

This commit is contained in:
Neil Lalonde
2013-04-11 16:04:20 -04:00
parent 8014d7fd25
commit 651cfba93f
21 changed files with 412 additions and 57 deletions

View File

@ -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?