title: Rails CanCan Auth Problem
body: <p>I am using the CanCan authorization plugin (<a href="http://github.com/ryanb/cancan" rel="nofollow noreferrer">http://github.com/ryanb/cancan</a>) for my application and it has worked great so far. I had it set like the following:</p>
  
  <pre><code>    class Ability
    include CanCan::Ability
  
    def initialize(user)
      user ||= User.new # guest user
  
      if user.role == "admin"
        can :manage, :all
      else
         can :read, :all 
  
  
      end
    end
  end
  </code></pre>
  
  <p>This allows me to designate some users Admins and only they can access write functions. Now I want to take it another step and make it so people who are not logged in at all (current_user/user_session does not exist) cannot access some controllers of the site. I know it should be some sort of elsif with the middle part of the code for the user and the final else for everyone else. However, I have not been able to figure out the best way to go about setting this up. Is anyone familiar with CanCan and have some ideas on how to best approach this type of situation.</p>
  
  <p>Thanks guys, every bit helps me learn more about rails and development in general!</p>