I have created a new menu and I'm trying to limit the access to a particular user to edit instead of role with the following code but it's not working, I still can't see the menu and edit the menus items by logging in with the relevant user login (user id 3 in this case). Wondering what's the proper way of doing.
/**
* Implements hook_menu().
*/
function menu_access_by_uid_menu(){
$items = array();
$items['admin/structure/menu/manage/new-menu'] = array(
'title' => 'New Menu',
'access callback' => 'menu_access_by_uid_validate',
);
return $items;
}
function menu_access_by_uid_validate() {
global $user;
if (user_is_logged_in() && ($user->uid == 1 || $user->uid == 3)){
return TRUE;
}
return FALSE;
}