ip bans: add hit counter, deleted flag, new ban type.

* Make IP bans soft deletable.
* Add a hit counter to track how many times an IP ban has blocked someone.
* Add a last hit timestamp to track when the IP ban last blocked someone.
* Add a new type of IP ban, the signup ban. Signup bans restrict new
  signups from editing anything until they've verified their email
  address.
This commit is contained in:
evazion
2020-04-06 14:12:56 -05:00
parent 98e84d83fb
commit b2ee1f0766
18 changed files with 178 additions and 40 deletions

View File

@@ -7,11 +7,11 @@ class IpBanPolicy < ApplicationPolicy
user.is_moderator?
end
def destroy?
def update?
user.is_moderator?
end
def permitted_attributes
[:ip_addr, :reason]
[:ip_addr, :reason, :is_deleted, :category]
end
end