How do I hide  the main menu items?
Drupal will hide menu items for paths that users don't have access to. But for this to work, it requires that the access callback for that menu item returns FALSE. If you handle access control in the menu callback instead, Drupal won't know that the user doesn't have access and will display the menu.

A solution would be to implement a custom access control module/function if you can't use any of the existing for the nodes.