api: remove available_includes dependent on current user.

This is to avoid specifying permissions in multiple disjoint places and
because most API users shouldn't need these fields.
This commit is contained in:
evazion
2020-02-16 19:58:14 -06:00
parent 9ef80d7344
commit 207861fd40
6 changed files with 6 additions and 19 deletions

View File

@@ -197,8 +197,6 @@ class Dmail < ApplicationRecord
end
def self.available_includes
includes_array = [:owner, :to, :from]
includes_array << :moderation_reports if CurrentUser.is_moderator?
includes_array
[:owner, :to, :from]
end
end