title: codeigniter useraccess design
body: <p>im  trying to use codeigniter to create a simple website that involve user restricted areas,</p>
  
  <p>and  was wondering how can i design my log in controller so that on every page it load a controller that <strong>check if this user is allowed in this page/allow to execute that function.</strong></p>
  
  <p>Question:</p>
  
  <ol>
  <li>how can i autoload this login function at every page.</li>
  <li>what is the proper <strong>secure</strong> logic to check for if user is allowed to do this function ? noting that i have 3 different user types, 1.admin 2.secretary 3.worker so how can i assign functions to there owner ? "admin should be able to assign access to other 2 types"</li>
  </ol>
  
  <p>i have completed my project but i have 0 experience with this login user access control thing so any advice will be appreciated</p>