Yo Drupal Knights!

In the e107 there is an option for menu visibility (for example visible only to ADMIN level)

How do you do it in drupal

Thanks a bunch! :)

Comments

gpk’s picture

In Drupal, menu visibility depends on whether the user has permissions to access the path that the menu refers, and the menu is automatically built accordingly. The admin -> user -> access control (permissions) page lets you define the basic permissions by role. To refine menu access permissions, have a look at http://drupal.org/project/menu_per_role. Usually however people use one of the many node access modules since it is usually access to content that needs controlling.

gpk
----
www.alexoria.co.uk

drupalfantwo’s picture

I also learned that I can just make a custom block containing links (in html) on the nodes and use one of the many node access available at drupal download.

Next question is out of the many node access control module is there any that automates menu visibility as well?

Thank you

gpk’s picture

What I was trying to say in my first reply was: if you build the menu as you want it in full, then people who don't have permissions to see the full menu (i.e. the don't have permissions to see *all* the pages the menu links point to) will only see the relevant bits.

Try it and see..

gpk
----
www.alexoria.co.uk

gpk’s picture

If anyone is still following this, in Drupal 5 you need http://drupal.org/project/remove_nonviewable_menu_items to prevent inaccessible nodes from being shown in the menus.

In Drupal 6 I believe this functionality is in core.

gpk
----
www.alexoria.co.uk

silurius’s picture

Somewhat related: I've been searching for a way to control menu item visibility per node. Is there an existing module or hack method that allows me to have a 'Home' primary link only appear on pages other than <front>?

gpk’s picture

The dirtiest hack I can think of is: in your page.tpl.php,

if (drupal_is_front_page()) {
  // unset the element of $primary_links that is the menu item for the Home page
  // do a print_r($primary_links) to check what the correct array key is
}

gpk
----
www.alexoria.co.uk