pundit: convert moderation reports to pundit.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user