After giving permission to specific users to see the admin menu (those users can see only 2 items on the admin menu, items are 2 custom modules i've created) I'm trying now to change the items titles if the user is not the admin.
Example : admin can see : 'all users profils' (it shows list of all users) but user A can see on the admin menu : 'my profil' where he can see only his profil (his profil is contained on the admin "all users profils"
this is my hook_menu_alter function :
function MyModule_menu_alter(&$items){
global $user;
if($user->uid = 1){ //if admin
$items['admin/editor']['title'] = 'all profils';}
else{ //if logged user
$items['admin/editor']['title'] = 'My Profil'; //show same table but only with user information (not all users table)
}
}
P.S. The code below show only one item