Is there a way to have a user menu that changes according to the permissions assigned to the user group a user belongs to? I am thinking of something that checks for these permissions at the view level, and also removes menu options a user does not have permission to.
Share
Yes it is possible to access the user object in the template and check if the user is staff like this:
This would be an example where your menu where li items of links. The admin link would only be rendered for users with is_staff status. The same could be done with is_authenticated.
Django is build to have logic and presentation separated, so if you want to do some more fine grained control of the menu, I would suggest doing the logic inside of the view, and then set a variable that you can check in the template to determine which menus to show.