title: Symfony2: Roles, Users and Grants from Database
body: <p>I'm beginning to use Symfony2 and I'm really enjoying it!</p>
  
  <p>I have some questions for sure that you will help me easily!</p>
  
  <p>When we use the security layer, the file security.yml we set the property access_control, usually something like this:</p>
  
  <ul>
  <li>{Path: ^ / admin roles: ROLE_ADMIN}</li>
  </ul>
  
  <p>Traditionally using php, my rule of access to the system I use 3 tables:</p>
  
  <ul>
  <li>User - Users Table</li>
  <li>Role - Roles Table</li>
  <li>Resource - Resource Table</li>
  <li>Permission - Grant Tables</li>
  </ul>
  
  <p>Where, User has a role, and a permission is related to a role and a resource. To check whether the user has access to a resource, check the table permission.</p>
  
  <p>Bringing Symfony2, the property "path" would be a resource and ROLE_ADMIN would be the role of the user.</p>
  
  <p>How to do that security.yml, load the settings from the database. I searched the official documentation and found nothing.</p>
  
  <p>For now, thanks</p>