I want to display a menu that changes according to the user group of the currently logged in user, with this logic being inside of my view, and then set a variable to check in the template to determine which menu items to show....I'd asked this question before, but my logic was being done in the template. So now I want it in my view...The menu looks as below
<ul class="sidemenu">
<li><a href="/">General List </a></li>
<li><a href="/sales_list">Sales List </a></li>
<li><a href="/add_vehicle">Add a New Record </a></li>
<li><a href="/edit_vehicle">Edit Existing Record </a></li>
<li><a href="/filter">Filter Records </a></li>
<li><a href="/logout">Logout </a></li>
</ul>
Suppossing the user is management, they'll see everything...But assuming the user is in the group sales, they'll only see the first two and the last two items...and so on. I also want a dynamic redirect after login based on the user's group. Any ideas?