Fix saved searces, news updates, ip bans being dumped to BigQuery.

Prevent saved searches, news updates, and ip bans from being publicly
dumped to BigQuery. They didn't override the `visible` method to
restrict their visibility for anonymous users.
This commit is contained in:
evazion
2021-03-10 02:25:56 -06:00
parent f235b72b3f
commit b169d60f64
7 changed files with 38 additions and 4 deletions

View File

@@ -12,6 +12,14 @@ class IpBan < ApplicationRecord
partial: 100
}, _suffix: "ban"
def self.visible(user)
if user.is_moderator?
all
else
none
end
end
def self.ip_matches(ip_addr)
where("ip_addr >>= ?", ip_addr)
end