title: custom finder with matching in association definition?
body: <p>I have two models: Contacts and Groups with belongsToMany association.</p>
  
  <p>I want to get only that groups what is accessible for the contact. For this I have a custom finder.</p>
  
  <pre><code>public function findAccessible(Query $query, array $options){
      return $query
              -&gt;where(['admin_user_id' =&gt; $options['User.id']])
              -&gt;orWhere(['public' =&gt; true])
              -&gt;matching('Users', function($q) use ($options){
                  return $q-&gt;orWhere(['Users.id' =&gt; $options['User.id']]);
              });
  }
  </code></pre>
  
  <p>So I can call to following and I will get what I want.</p>
  
  <pre><code>$accessibleGroups = $this-&gt;Contacts-&gt;Groups-&gt;find('accessible', ['User.id' =&gt; $this-&gt;Auth-&gt;user('id')]);
  </code></pre>
  
  <p>But if I have a contain, than it will give back all groups not just accessible ones.</p>
  
  <pre><code>$contact = $this-&gt;Contacts-&gt;get($id, [
          'contain' =&gt; ['Groups']
      ]);
  </code></pre>
  
  <p>How to limit the contain to accessible?</p>
  
  <p>I can not add the custom finder to the table association definition's finder property, as I can not pass the $options there. Or can I?</p>