title: Yii 2 RBAC multiple roles
body: <p>I'm building an app that will need complex user access rules.<br>
  Many roles have been identified (8 so far), each one with specific rules and independant to each other (not hierachical as a basic Supderadmin > admin > user can be)<br>
  Each user may be part of 1 or more "role" (every combination possible).  </p>
  
  <p>I've found a post talking about "group" assignements (<a href="https://stackoverflow.com/questions/29381801/yii2-rbac-multiple-assignments-for-each-user-based-on-groups">Yii2 RBAC Multiple Assignments for Each User Based on Groups</a>) but I can't figure out if it's suitable for my app or if I should change approach.</p>
  
  <p>Here is a quick (and simplified) sample of roles and permissions : </p>
  
  <p>A Supervisor may :<br>
   - Access supervisors specific module<br>
   - Edit some parts of articles he supervise<br>
   - validate articles he supervise  </p>
  
  <p>A writter may :<br>
   - Acces writters specific module<br>
   - Create new articles<br>
   - Edit it's own articles  </p>
  
  <p>A Section manager may :<br>
   - Access sections module<br>
   - publish/unpublish acticles in sections he manage  </p>
  
  <p>In that sample :<br>
   - a section manager may also be a writter (but not a supervisor)<br>
   - a section manager may also be a supervisor (but not a writter) </p>
  
  <p>Is there a way to achieve that with RBAC ?  </p>
  
  <p>Thanks for your advises </p>