How can I hide menu items based on permissions? In my main menu I have a "menu item 1" that links to mynode1.

I have successfully implemented hook_permission() and hook_node_access() so that users who do not have the "access menu item 1" permission  cannot access mynode1. 

I assumed that the menu item link "menu item 1" would automatically be hidden by Drupal, but this is not the case. Therefore I now would like to hide that menu item to users who do not have "access menu item 1" permission.

Does anyone have a code sample that would hide a menu link based on permission? (I tried hook_menu_alter() with no luck.)
Hi have done it this way:

function mymodule_menu_link_alter(&amp;$item) 
 {
  $item['options']['alter'] = TRUE;                                                                                                                                                      
 } 

function mymodule_translated_menu_link_alter(&amp;$item, $map) 
 {

  if (!empty($item['access'])) {

  if(
   ( $item['link_title']=="MyLinkToHide1" &amp;&amp; !user_access("access link 1") ) ||
   ( $item['link_title']=="MyLinkToHide2" &amp;&amp; !user_access("access link 2") )

   )
   {
            $item['access'] = FALSE;
   }

 }
}