title: CanCan has_many through, specific abilities
body: <p>I'm currently making a project using devise and cancan.</p>
  
  <p>To understand my problem i have this models :</p>
  
  <p><strong>User</strong> with some attributes and is_admin boolean to global access</p>
  
  <p><strong>Role</strong> belongs_to project and user with a specific ability for user on each project</p>
  
  <p><strong>Project</strong> has_many some others models user can edit or not (depend of it's role on the project)</p>
  
  <p>So my question is how can I do this ?</p>
  
  <p>Actually I have this Ability class :</p>
  
  <pre><code>class Ability
    include CanCan::Ability
    def initialize(user)
      if user
        can :read, :all                   # allow everyone to read everything
        if user.is_admin?
          can :manage, :all
        end
      end
    end
  end
  </code></pre>
  
  <p>I need to manage role in models depend on my Project model or something else ? 
  Thank you in advance.</p>