Commit f87ec250 authored by evazion's avatar evazion

modreports: fix reporting inaccessible dmails and forum posts.

* Fix it being possible to report dmails belonging to other users.
* Fix it being possible to report forum posts in mod-only threads.
parent a5ebbc04
......@@ -189,7 +189,7 @@ class Dmail < ApplicationRecord
end
def reportable_by?(user)
is_recipient? && !is_automated? && !from.is_moderator?
owner == user && is_recipient? && !is_automated? && !from.is_moderator?
end
def dtext_shortlink(key: false, **options)
......
......@@ -95,7 +95,7 @@ class ForumPost < ApplicationRecord
end
def reportable_by?(user)
creator_id != user.id && !creator.is_moderator?
visible?(user) && creator_id != user.id && !creator.is_moderator?
end
def votable?
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment