title: php role based access control system - permission on pages basis
body: <p>I am going to design a system. System has 3 users types. Admin, Managers, Developers.
  Application is consists with 100 php UI pages. </p>
  
  <ol>
  <li>database table is like this ( page, admin, manager, developer). page is the pagename, admin, manager, developer are boolean fields. If perticular field is 1 or true role has the permission to access.</li>
  <li>Now I need to synchronize the database with all 100 pages. I know the which role the logged in user is belongs. But I don't know how to pass the page and match it with table to check whether the particular user has access. </li>
  </ol>
  
  <p>My plan is to put 
  checkpermission($_SERVER['PHP_SELF'], $role); to each page.
  How should I do this properly ?
  Is it ok if I put this line to header.php. Will it be bad design ?</p>
  
  <p>My leads main concern is extendability. He want to plug another site without changing much. Also we want to give a page. Admin can use that page to give, remove permissions. add subdirectory to the permission tree. </p>