openstreetmap-website/app/models/acl.rb
Tom Hughes 10b71ba2f6 Add an ACL system to allow key/value pairs to be attached to blocks
of IP addresses, and implement an ACL restriction that allows account
creation to be blocked.
2009-02-19 13:47:43 +00:00

13 lines
428 B
Ruby

class Acl < ActiveRecord::Base
def self.find_by_address(address, options)
self.with_scope(:find => {:conditions => ["inet_aton(?) & netmask = address", address]}) do
return self.find(:first, options)
end
end
def self.find_all_by_address(address, options)
self.with_scope(:find => {:conditions => ["inet_aton(?) & netmask = address", address]}) do
return self.find(:all, options)
end
end
end