pundit: convert moderation reports to pundit.

This commit is contained in:
evazion
2020-03-17 23:09:32 -05:00
parent 480f39c34a
commit 9242bf522b
16 changed files with 60 additions and 58 deletions

View File

@@ -81,10 +81,6 @@ class ForumPost < ApplicationRecord
end
end
def reportable_by?(user)
visible?(user) && creator_id != user.id && !creator.is_moderator?
end
def votable?
bulk_update_request.present? && bulk_update_request.is_pending?
end
@@ -99,10 +95,6 @@ class ForumPost < ApplicationRecord
end
end
def visible?(user, show_deleted_posts = false)
user.is_moderator? || (user.level >= topic.min_level && (show_deleted_posts || !is_deleted?))
end
def update_topic_updated_at_on_create
if topic
# need to do this to bypass the topic's original post from getting touched