title: before_action with "or" statement
body: <p>I have several different user types within my application. I was trying to do something like this when accessing a controller;</p>
  
  <pre><code>class Admins::ProgrammesController &lt; ApplicationController
    # only allow entry if the user is one of these types.
    before_action :authenticate_admin! || :authenticate_super_admin! || :authenticate_programme_leader! || :authenticate_caseworker!
  
    def index
    end
  </code></pre>
  
  <p>To check the users type is allowed to access this controller.</p>
  
  <p>Alas, that does not seem to be right. Rails only pays attention to the first <code>before_action</code> argument - checks if the user is admin. So my spec does not pass if user is caseworker for example.</p>
  
  <p>How can I achieve this in a similar way?</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>As requested, more code..</p>
  
  <p>This is my failing spec;</p>
  
  <pre><code>RSpec.describe Admins::ProgrammesController, :type =&gt; :controller do
    context 'authenticated user' do
      before :each do
        @user = FactoryGirl.create :caseworker
        sign_in @user
      end
  
      describe 'GET index' do
        it 'responds with a 200 OK status code' do
          get :index
          expect(response).to have_http_status(:success)
        end
      end
    end
  end
  </code></pre>
  
  <p>I am 100% confident that the Casework type user is being created. Here is the factory;</p>
  
  <pre><code>FactoryGirl.define do
    factory :caseworker, class: 'Users::Caseworker' do
      email { "me@example.com" }
      password { "password" }
    end
  end
  </code></pre>
  
  <p>Here is the relevant lines from the routes file;</p>
  
  <pre><code>Rails.application.routes.draw do
    devise_for :users, controllers: {sessions: 'users/sessions'}, skip: :registrations
    devise_for :admins, class_name: 'Users::Admin'
    devise_for :caseworker, class_name: 'Users::Caseworker'
    devise_for :cardholder, class_name: 'Users::Cardholder'
    devise_for :programme_leader, class_name: 'Users::ProgrammeLeader'
    devise_for :super_admin, class_name: 'Users::SuperAdmin'
  
    scope module: 'admins' do
      # this is the route in question...
      resources :programmes, only: [:index, :show, :new]
  </code></pre>