title: Rails pundit authorize specific controller actions
body: <p>So I'm using Pundit to check for authorization access.</p>
  
  <p>Before each controller in my application, I have</p>
  
  <pre><code>class ReservationsController &lt; ApplicationController
    before_action :authorize_reception!
  </code></pre>
  
  <p>With the helper module:</p>
  
  <pre><code>module AuthorizeMethods
    def authorize_admin!
      authorize User, :admin?
    end
    def authorize_reception!
      authorize user, :allow_reception?
    end
  </code></pre>
  
  <p>And also this User policy</p>
  
  <pre><code>class UserPolicy
    def initialize(user, _resource)
      @user = user
    end
  
    def admin?
      @user.hotel_admin
    end
  
    def reception?
      admin? || @user.allow_reception
    end
  </code></pre>
  
  <p>I now want to give access to reception roles to JUST the action :index from the reservations controller.</p>
  
  <p>I came up with this:</p>
  
  <pre><code>class ReservationsController &lt; ApplicationController
    sip_before_action :admin!, only: [:index]
    before_action :authorize_reception!, only: [:index]
  </code></pre>
  
  <p>So that for every other action it needs an admin, and for index, just a reception role. But my reception role, is having access to all actions of the controller (edit, delete, create), not just index.</p>