Disallow a user from seeing flagger's name on own uploads

This commit is contained in:
BrokenEagle
2017-11-07 20:02:03 -08:00
parent af7c109912
commit 5b4ab8d80e
8 changed files with 52 additions and 8 deletions

View File

@@ -557,6 +557,10 @@ class User < ApplicationRecord
is_moderator? || flagger_id == id
end
def can_view_flagger_on_post?(flag)
(is_moderator? && flag.not_uploaded_by?(id)) || flag.creator_id == id
end
def upload_limit
@upload_limit ||= [max_upload_limit - used_upload_slots, 0].max
end