title: Rails 4 devise , How to sign up new users if signed in?
body: <p>I want to block signup for non-admins so that only a superuser/administrator can add new users. How can I achieve that?</p>
  
  <p>I tried following the method mentioned here: <a href="https://stackoverflow.com/questions/4213006/devise-before-filter-that-prevents-access-to-new-user-registration-path-unless">Devise before filter that prevents access to “new_user_registration_path” unless user is signed-in</a> but had no results.</p>
  
  <p>I have installed devise, cancan and rolify. In addition, I also don't want anyone to go to the <code>/users/sign_up</code> page and sign in. Only admins must have the ability to sign up new users.</p>
  
  <p>Due to the devise installation there is no users controller. Please guide me through making one if needed.  </p>
  
  <p><code>routes.rb</code></p>
  
  <pre><code>FifthApp::Application.routes.draw do
    devise_for :users
    resources :qanotes
  end
  </code></pre>
  
  <p><code>user.rb</code></p>
  
  <pre><code>class User &lt; ActiveRecord::Base
  
    #resourcify :resources
    rolify
  
    has_many :qanotes
  
    # Include default devise modules. Others available are:
    # :token_authenticatable, :confirmable,
    # :lockable, :timeoutable and :omniauthable
    devise :database_authenticatable, :registerable,
           :recoverable, :rememberable, :trackable, :validatable
  
  end
  </code></pre>
  
  <p>I keep on getting redirected to the root, i.e. localhost:3000, when I try to go to sign up page (only after log in).</p>