* 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.
18 lines
254 B
Ruby
18 lines
254 B
Ruby
class IpBanPolicy < ApplicationPolicy
|
|
def create?
|
|
user.is_moderator?
|
|
end
|
|
|
|
def index?
|
|
user.is_moderator?
|
|
end
|
|
|
|
def update?
|
|
user.is_moderator?
|
|
end
|
|
|
|
def permitted_attributes
|
|
[:ip_addr, :reason, :is_deleted, :category]
|
|
end
|
|
end
|