The menu system is cached, so you cannot add or remove menu items as you wish, based on the user, page view, user logic, etc. That is, you cannot do this without clearing the menu cache, which cause a serious defeat.
What you can do to create this effect is to create some custom logic to define an access control in a menu item. Since Drupal hides menu items that users do not have access to, under certain circumstances you can prevent the menu item from being hidden. This is a bit of a hacker solution.
Another solution I would prefer would be to use js or css to hide or show the menu. You can dynamically add / remove a class in the body to determine whether a menu item should be displayed or not. However, this would quickly become unmanageable if you needed several of these menu items.
source
share