title: How to restrict user to search for a particular model in view?
body: <p>Application I am working has different user roles client, project manager and super user and on landing page they can search for Articles and there is an <strong>advanced filter</strong> to filter out records after search. <strong>Like:</strong> Filter by Author.</p>
  
  <p>I want to hide advance filter for client, for that I want to define ability using <strong>cancancan</strong>.</p>
  
  <p>Currently I am doing it with model methods. These methods return true and false on the basis of user type.</p>
  
  <pre><code>client?
  project_manager?
  super_user?
  </code></pre>
  
  <p><strong>Current Code:</strong></p>
  
  <pre><code>&lt;% unless current_user.client? %&gt;
     &lt;%=link_to "Advance Search", "#" %&gt;
  &lt;%end%&gt;
  </code></pre>
  
  <p>I want to remove this and use cancancan instead of this.</p>
  
  <pre><code>&lt;%if can? :filter, Article %&gt;
    &lt;%=link_to "Advance Search", "#" %&gt;
  &lt;%end%&gt;
  </code></pre>
  
  <p>For this I tried</p>
  
  <pre><code>cannot :filter, Article if user.client?
  </code></pre>
  
  <p>But this is restricting all users to filter.</p>