     (selector, options) ->
       options = options or {}
       options.fields = options.fields or {}
-      for field, fieldRule of self.rules when fieldRule['visible']?
+      for field, fieldRule of self._rules when fieldRule['visible']?
         rule = fieldRule['visible']
         if typeof rule is 'function'
           value = rule.apply this, arguments


  constructor: (@collection) ->
    @id = @collection._name
    @rules = {}

    @collection.allow
      insert: @getSecFunction 'allow', 'insert'

      fields.push key for key, value of doc if fields.length is 0

      values = []
      for field, fieldRule of self._rules when field in fields
        if typeof fieldRule[scope] is 'object'
          rule = fieldRule[scope][type]
        else
