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

@@ -163,8 +163,6 @@ class PostFlag < ApplicationRecord
end
def self.available_includes
includes_array = [:post]
includes_array << :creator if CurrentUser.user.is_moderator?
includes_array
[:post]
end
end