pundit: convert ip bans to pundit.
This commit is contained in:
17
app/policies/ip_ban_policy.rb
Normal file
17
app/policies/ip_ban_policy.rb
Normal file
@@ -0,0 +1,17 @@
|
||||
class IpBanPolicy < ApplicationPolicy
|
||||
def create?
|
||||
user.is_moderator?
|
||||
end
|
||||
|
||||
def index?
|
||||
user.is_moderator?
|
||||
end
|
||||
|
||||
def destroy?
|
||||
user.is_moderator?
|
||||
end
|
||||
|
||||
def permitted_attributes
|
||||
[:ip_addr, :reason]
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user