Hi everyone,
a feature that I would like to see implemented would be the ability to restrict users to use certain menus - primarily just to be able to stop them posting content in the System menus. It might also be a nice feature to be able to restrict certain roles or content types to certain menus either.
At the moment, I don't want users to be able to place nodes anywhere expect in my custom menu. The only way I could find of achieving this was by changing the following line from TRUE to FALSE in the core menu.module file -
#441 function menu_get_menus($all = TRUE) {
#442 $system_menus = menu_list_system_menus();
#443 $sql = 'SELECT * FROM {menu_custom}';
#444 if (!$all) {
#445 $sql .= ' WHERE menu_name NOT IN ('. implode(',', array_fill(0, count($system_menus), "'%s'")) .')';
#446 }
#447 $sql .= ' ORDER BY title';
#448 $result = db_query($sql, $system_menus);
#449 $rows = array();
#450 while ($r = db_fetch_array($result)) {
#451 $rows[$r['menu_name']] = $r['title'];
#452 }
#453 return $rows;
#454 }
I would assume it would be fairly simple to be able to have a setting toggling this value between TRUE/FALSE, but I wouldn't have enough knowledge to be code it myself. I realise the way I'm doing this at the moment is liable to be overwritten by upgrades etc, so wanted a safer way to get this functionality.
Please let me know if you need any more information on the above.
(If there is no more functionality going into v7, please disregard the above - well, maybe until v8 is coming along! =) )
Thanks.
All the best,
Dave
Comments
Comment #1
mdupontThere are contrib modules that allow to achieve that, such as http://drupal.org/project/menu_per_role. I don't think it should be added to Drupal core, as the statistics shows it is not so popular (not even in top 100 of contrib modules). Closing this issue.