Display main menu for logged in users only
If you are assigning main menu (as block) to region, you can control it's visibility by "Visibility settings". If you are rendering it in .tpl.php file then you can do it like this: Example (bartik's page.tpl.php):

&lt;?php if ($main_menu &amp;&amp; user_is_logged_in()): ?&gt;
  &lt;div id="main-menu" class="navigation"&gt;
    &lt;?php print theme('links__system_main_menu', array(
      'links' =&gt; $main_menu,
      'attributes' =&gt; array(
        'id' =&gt; 'main-menu-links',
        'class' =&gt; array('links', 'clearfix'),
      ),
      'heading' =&gt; array(
        'text' =&gt; t('Main menu'),
        'level' =&gt; 'h2',
        'class' =&gt; array('element-invisible'),
      ),
    )); ?&gt;
  &lt;/div&gt; &lt;!-- /#main-menu --&gt;
&lt;?php endif; ?&gt;