Hide tab for user page for specific roles
You can use arg() function. The function returns a component of the current Drupal path. i.e. if you're on edit user page, the values returned by arg() function will be arg(0) as 'user', arg(1) as user ID, arg(2) as 'edit'.

function bartik_preprocess_page(&amp;$variables, $hook) {
  $arg = arg();
  if (('user' == $arg) &amp;&amp; (!empty($arg[1]) &amp;&amp; is_numeric($arg[1])) &amp;&amp; in_array('editor', $variables['user']-&gt;roles)) {
    // Your code goes here..
  }
}