Hide menu backend side for different roles/users I'd like to hide some menu on the backend side /admin/structure/menu and make the hidden items to disappear of the navigation menu for a specific user/role.

I managed to hide the list of the menu visible in the page /admin/structure/menu but it's just the list which as been changed, meaning they can access by accessing to the url.

function module_menu_alter(&amp;$items) {
    $items['admin/structure/menu/manage/devel']['page callback'] = 'module_change_devel';
    $items['admin/structure/menu']['page callback'] = 'module_change_menus';
}

function module_change_menus() {

    global $user;
    if(!in_array('administrator', $user-&gt;roles)){
        $result = db_query("SELECT * FROM {menu_custom} 
            WHERE menu_name='menu-contact-us' 
            OR menu_name='menu-1' 
            OR menu_name = 'menu-3' 
            OR menu_name = 'menu-2' 
            ORDER BY title", 
            array(), 
            array('fetch' =&gt; PDO::FETCH_ASSOC));
    }
    else{
       $result = db_query("SELECT * FROM {menu_custom} 
           ORDER BY title", 
           array(), 
           array('fetch' =&gt; PDO::FETCH_ASSOC)); 
    }
    $rows = array();
    $header = array(t('Title'), array('data' =&gt; t('Operations'), 'colspan' =&gt; '3'));
    foreach ($result as $menu) {
    $row = array(theme('menu_admin_overview', array('title' =&gt; $menu['title'], 'name' =&gt; $menu['menu_name'], 'description' =&gt; $menu['description'])));
    $row[] = array('data' =&gt; l(t('list links'), 'admin/structure/menu/manage/' . $menu['menu_name']));
    $row[] = array('data' =&gt; l(t('edit menu'), 'admin/structure/menu/manage/' . $menu['menu_name'] . '/edit'));
    $row[] = array('data' =&gt; l(t('add link'), 'admin/structure/menu/manage/' . $menu['menu_name'] . '/add'));
    $rows[] = $row;
    }
    return theme('table', array('header' =&gt; $header, 'rows' =&gt; $rows));

}


function menu_change_devel() {

    global $user;
    if(in_array('administrator', $user-&gt;roles) == 1){
        $items['admin/structure/menu/manage/devel']['access arguments'] =  array('aminister users');
        return $items;
    }
}


But the function menu_change_devel which is supposed to give the access to admin/structure/menu/manage/devel for the user having the permission to aminister users doesn't seem to work :(

Any idea ?

Cheers

EDIT :
I found the solution

function MODULE_menu_alter(&amp;$items) {

    //deny the menu if they are not admin (if they don't have the acess right to adsminister users)
    $items['admin/structure/menu/manage/%menu']['access callback'] = array('MODULE_check_menus_access');
    $items['admin/structure/menu/manage/%menu']['access arguments'] = array(4, 'administer menu');
    //edit
    $items['admin/structure/menu/manage/%menu/edit']['access callback'] = array('MODULE_check_menus_access');
    $items['admin/structure/menu/manage/%menu/edit']['access arguments'] = array(4, 'administer menu');
    //add
    $items['admin/structure/menu/manage/%menu/add']['access callback'] = array('MODULE_check_menus_access');
    $items['admin/structure/menu/manage/%menu/add']['access arguments'] = array(4, 'administer menu');
}

function MODULE_check_menus_access($menu, $permission){
    global $user;
    $account = $user;

    if (user_access($permission, $account)) {
        if(array_key_exists ($menu['menu_name'], $menuList)){
            return user_access('can manage '.$menu['menu_name'], $account);
        }
        else{
            return true;
        }
    }
}

/**
 * Implements hook_permission().
 */
function MODULE_permission() {
  return array(
    'can manage navigation' =&gt;  array(
      'title' =&gt; t('Can manage navigation menu'),
      'description' =&gt; t('Limit access to the navigation menu'),
      ),
    );
}
You can use Menu item visibility module to hide the item for specific user role.


  This module exposes configurable and extendable visibility settings
  for menu links. For example, if you want to create a 'My account' link
  that points to /user, both anonymous and registered users have access
  to the /user path, so both will see the link, even if anonymous users
  do not technically have an account. Using this module will allow you
  to only have your 'My account' link visible to registered users, and
  hide it from anonymous users.