title: How to implement authorization?
body: <p>Suppose, I have a model called Animal. This model contains enum attribute with two possible states.</p>
  
  <pre><code>class Animal &lt; ActiveRecord::Base
    enum kind: [ :cat, :dog ]
  end
  </code></pre>
  
  <p>Then in my controller I create different instance variables.</p>
  
  <pre><code>class AnimalsController &lt; ApplicationController
    def index
      @cats = Animal.cat
      @dogs = Animal.dog
    end
  end
  </code></pre>
  
  <p>In my view I got two separate collections.</p>
  
  <pre><code>&lt;h1&gt;Animals&lt;/h1&gt;
  
  &lt;%= render partial: 'animals/cat', collection: @cats, as: :cat %&gt;
  &lt;%= render partial: 'animals/dog', collection: @dogs, as: :dog %&gt;
  </code></pre>
  
  <p>How can I make an authorization to be able to edit the first collection's resources and not to be able to edit the second ones?</p>
  
  <p>The following approach won't work because it works only for one action entirely.</p>
  
  <pre><code>before_action :current_user_only, except: [:edit]
  </code></pre>
  
  <p>So, how do I implement that kind of authorization?</p>
  
  <p>Thanks in advance!</p>