Add support for domain based ACLs
[rails.git] / app / models / acl.rb
1 class Acl < ActiveRecord::Base
2   def self.match(address, domain = nil)
3     if domain
4       condition = Acl.where("address >> ? OR domain = ?", address, domain)
5     else
6       condition = Acl.where("address >> ?", address)
7     end
8   end
9 end