How to hide tabs, depending on the role of editing using menu_alter I have 3 types of accounts: Admin, Student and Tutor.

After I turned on the path user / %user / edit / tutor, I see two tabs editing: Student and Tutor. But I want to only display the tab tutor when I edit tutor.

I'm using module profile, which adds tabs unknown way.

Any suggestions?
Using hook_menu_alter you put restriction by passing role in access argument like "tutor" or "student".

function MYMODULE_menu_alter(&amp;$items) {
  $items['menu_item']['access callback'] = 'user_has_role',
  $items['menu_item']['access arguments'] = array('tutor'),
}

function user_has_role($roles) {
  if (user_is_logged_in()) {
    global $user;
    if (in_array('administrator', $user-&gt;roles)) {
      return TRUE;
    }
    foreach ($roles as $role) {
      if (in_array($role, $user-&gt;roles)) {
        return TRUE;
      }
    }
  }else {
    return FALSE;
  }
}