title: How to assemble an admin menu dynamically?
body: <p>I'm trying to work out the best way to assemble the navigation menu of my admin application dynamically, based on the result of going through each of the objects on each of the pages, such that only pages with objects that are available to the user are displayed in the menu!</p>
  
  <p>As a simple example, say I have two user types; SECRETARY and MANAGER. I have a simple admin page to manage staff with two fields that I can update; "address" and "date of birth". Normally, both fields have an access level which allows SECRETARY to do our normal CRUD operations. Our administrator comes along one day and decides that "date of birth" needs MANAGER level access - it's straight-forward enough to hide that field on the page or make it read-only. Now, all of a sudden, the administrator decides that the "address" field needs MANAGER level access too. Given there are no fields on this page available to the SECRETARY user now, how does my menu know to display it or not (without creating a separate rule for the menu option)?</p>
  
  <p>Things like ACL and Navigation in Zend only seem to go as far as making a menu option an access control object. This: <a href="http://www.tonymarston.net/php-mysql/role-based-access-control.html#menu-system" rel="nofollow noreferrer">http://www.tonymarston.net/php-mysql/role-based-access-control.html#menu-system</a> seems to do what I'm asking, but I can't find any demos or code chunks which talk about this particular topic.</p>
  
  <p>The next question is, if I have to go as far as maintaining a list of all the objects on a page in the db, why not include the HTML in the db too, and have the application dynamically assemble the page instead of using a View + template? (could be cached of course)</p>
  
  <p>Any suggestions?</p>