pundit: convert ip addresses to pundit.
This commit is contained in:
@@ -1,9 +1,8 @@
|
||||
class IpAddressesController < ApplicationController
|
||||
respond_to :html, :xml, :json
|
||||
before_action :moderator_only
|
||||
|
||||
def index
|
||||
@ip_addresses = IpAddress.visible(CurrentUser.user).paginated_search(params)
|
||||
@ip_addresses = authorize IpAddress.visible(CurrentUser.user).paginated_search(params)
|
||||
|
||||
if search_params[:group_by] == "ip_addr"
|
||||
@ip_addresses = @ip_addresses.group_by_ip_addr(search_params[:ipv4_masklen], search_params[:ipv6_masklen])
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
module Moderator
|
||||
class IpAddrsController < ApplicationController
|
||||
before_action :moderator_only
|
||||
respond_to :html, :json
|
||||
|
||||
def index
|
||||
authorize IpAddress
|
||||
@search = IpAddrSearch.new(params[:search])
|
||||
@results = @search.execute
|
||||
respond_with(@results)
|
||||
|
||||
Reference in New Issue
Block a user