]> git.openstreetmap.org Git - rails.git/blobdiff - app/models/acl.rb
Add convenience methods to make ACL use simpler
[rails.git] / app / models / acl.rb
index e19c6988b4100e59f61e5a5c5a503c9e4c97b4f0..9938984aa89a3d83cef907430c6288fed3aabe07 100644 (file)
@@ -6,4 +6,12 @@ class Acl < ActiveRecord::Base
       condition = Acl.where("address >> ?", address)
     end
   end
+
+  def self.no_account_creation(address, domain = nil)
+    self.match(address, domain).where(:k => "no_account_creation").exists?
+  end
+
+  def self.no_trace_download(address, domain = nil)
+    self.match(address, domain).where(:k => "no_trace_download").exists?
+  end
 end