title: Devise: Restricting Actions to Administrators
body: <p>Following the guide here, I added a boolean attribute to my database using a migration:</p>
  
  <pre><code>rails generate migration add_admin_to_user admin:boolean
  </code></pre>
  
  <p>I've configured my account to be an admin (admin = 1) via Rails console. I have a controller that I want to restrict access to certain actions (new, edit, create, and destroy) for administrators only.</p>
  
  <p>I'll also have normal users, I just want to restrict access to these actions for admins only in this controller. Currently, I'm using the code:</p>
  
  <pre><code>before_filter :authenticate_user!, :only =&gt; [:new, :edit, :create, :destroy]
  </code></pre>
  
  <p>Which restricts access to registered users -- how do I take this a step further and require admins?</p>