JavaScript Structuring a navbar that will change based on type of account logged in

I have a web design question that I'm trying to puzzle out. Essentially I'm looking to design a navbar such that it will change what buttons/links are displayed in the navbar based on what type of account is signed in. So if a standard user is signed up they might see:

Site Name | Account Settings | Logout

But if an admin is logged in they would see:

Site Name | Account Settings | Manage Users | Logout

I'm using MEANjs for this website, and I have an idea as to how to implement it, but I'm not positive it will work. Basically in Appname\public\modules I think I can make a 'navbar' module, which will have HTML and a controller. The controller would check what type of user is logged in and with conditional statements display certain links and not others. Then in any of my views I would just include the navbar module as the top item. Would this be a good approach?

Along these lines, I'm having trouble coming up with a way to customize other features based on what type of account is logged in. For instance, I want to do a standard home page for un-logged in users, say another home page for users that are logged in, and a third homepage for admins that are logged in. How should this all be handled with MEANjs in terms of file structure? A bit lost here and looking for some light to be shed, so thanks all. If it helps, here's a screenshot of the current site architecture:

http://i.imgur.com/j7IohQK.png

Answer:1

I have a common header for all of the pages I have in my site. When I click on any link it takes me to that page and the page gets refreshed. But the header is the same as it was in the previous ...

I have a common header for all of the pages I have in my site. When I click on any link it takes me to that page and the page gets refreshed. But the header is the same as it was in the previous ...

  1. change active link color css
  2. change active link color
  3. change active link when scrolling
  4. change active link color css bootstrap
  5. change active link color bootstrap
  6. change active link in navbar
  7. change active link color javascript
  8. change active link color divi
  9. change active link jquery
  10. change active link
  11. change active link html
  12. change link color active page css
  13. html change active link color
  14. change color active link using jquery
  15. bootstrap change active link
  16. change link color on active page
  17. css change active link
  18. bootstrap navbar change active link
  19. bootstrap navbar change active link color
  20. change background color active link css

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script> <script> var siteTitle = $.ajax({ url: 'http/', type: 'POST', ...

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script> <script> var siteTitle = $.ajax({ url: 'http/', type: 'POST', ...

  1. make javascript load faster
  2. javascript load image faster

I have a page which has 2 text areas and wanted to validate each text area if the characters being typed is more than max length upon clicking submit button. Problem with the code below when clicking ...

I have a page which has 2 text areas and wanted to validate each text area if the characters being typed is more than max length upon clicking submit button. Problem with the code below when clicking ...

  1. jquery validation multiple textarea

first of all I apologize for my bad English, I want to make a JavaScript for a tabele who makes himself automatically by the ID Bold, just like this one here but the code is not only for weeks for ...

first of all I apologize for my bad English, I want to make a JavaScript for a tabele who makes himself automatically by the ID Bold, just like this one here but the code is not only for weeks for ...