I have implemented
hook_menu_link_alter so that a menu link is altered for some authenticated users, but not for all. My implementation of
In Drupal 6 I must clear the cache so that the menu links are rebuild and so that the changes that I have in the hook are applied.
However, that also means that the modified link in stored in the cache. So if another user then logs on who doesn't need the change, then this user also sees the change because it was cached?
I know that a solution could be to have 2 menu's and use PHP code to decide which one is shown to which user, but this is not what I want. I'm building this in a generic module that is available from drupal.org, so I don't was to go duplicating menu's in other people's websites. Another solution could be to rebuild the menu cache after every logon, but I fear that this is quite resource intensive.
Does anybody have advice on how this can be handled?