title: ACL implementation in symfony2
body: <p>Am new to symfony and need to work on ACL part
  I Need to built the ACl in my project, which can be explained with below table</p>
  
  <pre><code>Users/Access    User_List_View  User_Create User_Edit   User_Delete User_Status Edit_ownDetails
  Super Admin     Yes             Yes         Yes         Yes         Yes         Yes
  Admin           Yes             No          Yes         No          Yes         Yes
  Client          No              No          No          No          No          Yes
  </code></pre>
  
  <p>Role Assign</p>
  
  <pre><code>User    Role
  User-A  Super Admin
  User-B  Admin
  User-C  Client
  User-D  Client
  </code></pre>
  
  <p>I have checked many of the link below<br>
  <a href="http://symfony-gu.ru/documentation/en/html/cookbook/security/acl.html" rel="nofollow noreferrer">http://symfony-gu.ru/documentation/en/html/cookbook/security/acl.html</a><br>
  <a href="https://github.com/Problematic/ProblematicAclManagerBundle" rel="nofollow noreferrer">https://github.com/Problematic/ProblematicAclManagerBundle</a><br>
  <a href="https://www.adayinthelifeof.nl/2012/07/04/symfony2-implementing-acl-rules-in-your-data-fixtures/" rel="nofollow noreferrer">https://www.adayinthelifeof.nl/2012/07/04/symfony2-implementing-acl-rules-in-your-data-fixtures/</a><br>
  <a href="http://knpuniversity.com/screencast/question-answer-day/symfony2-users-menu-cms" rel="nofollow noreferrer">http://knpuniversity.com/screencast/question-answer-day/symfony2-users-menu-cms</a><br>
  <a href="https://knpuniversity.com/screencast/symfony-voters" rel="nofollow noreferrer">https://knpuniversity.com/screencast/symfony-voters</a><br>
  <a href="http://kriswallsmith.net/page/4" rel="nofollow noreferrer">http://kriswallsmith.net/page/4</a><br>
  <a href="http://problematic.io/2012/03/10/symfony2-bundles-i-cant-live-without/" rel="nofollow noreferrer">http://problematic.io/2012/03/10/symfony2-bundles-i-cant-live-without/</a><br></p>
  
  <p>Most popular what I found was the FOSUserbundle but I need to achieve that writing manually with the role, for the same I also checked the voter which is also a good one but the requirement of my client is that he should even be able to create a custom rights for each of the individual user. So I need to implement the ACL like table structure which should be easy for him to modify at individual level.<br></p>
  
  <p>For creating a sample i tried to implement the <a href="http://symfony.com/doc/current/cookbook/security/acl.html" rel="nofollow noreferrer">http://symfony.com/doc/current/cookbook/security/acl.html</a>, but from the link I did not clearly understood where to add the role for the user and how to check my grid for the roles and access. The document seems to be very difficult to understand for implementation.</p>
  
  <p>If anyone has achieved this in some or the other way OR using any of the third party library?</p>
  
  <p>Even I have checked the following link in stackoverflow but there is no response which I can use
  <a href="https://stackoverflow.com/questions/19431454/symfony-acl-implementation">Symfony Acl implementation</a><br>
  <a href="https://stackoverflow.com/questions/8921145/how-to-make-advanced-acl-in-symfony2">How to make advanced ACL in Symfony2?</a>
  <a href="https://stackoverflow.com/questions/24078270/check-if-a-role-is-granted-for-a-specific-user-in-symfony2-acl">Check if a role is granted for a specific user in Symfony2 ACL</a>
  <a href="https://stackoverflow.com/questions/6915502/symfony2-acl-roles-and-users">https://stackoverflow.com/questions/6915502/symfony2-acl-roles-and-users</a></p>