I've been developing for long time on top of framework like Symfony2 and Laravel that I don't have a clue about what I will be asking and sounds like a dummy question for old developers but .... ![Sad Sad]()
I am starting a new simple application and I will be using: IonAuth for authentication/authorization and I was thinking in KnpMenu for built dynamic menus (I am open to suggestion for this one since I don't know to much packages for CI just yet)
Since the menus should be based on roles/permission the idea is:
This "query the database, find the proper items and built the menu" should be the first code executed before every page load or maybe I should use another mechanism for just make this one time (after successful login) (again I am open to suggestion to this one as well).
So my question is, how would you handle this?

I am starting a new simple application and I will be using: IonAuth for authentication/authorization and I was thinking in KnpMenu for built dynamic menus (I am open to suggestion for this one since I don't know to much packages for CI just yet)
Since the menus should be based on roles/permission the idea is:
- Start the application and goes to login page
- Logged in successful
- Query the database, find the proper items and built the menu
- Redirect user to the homepage or dashboard
This "query the database, find the proper items and built the menu" should be the first code executed before every page load or maybe I should use another mechanism for just make this one time (after successful login) (again I am open to suggestion to this one as well).
So my question is, how would you handle this?