Hide node "edit" tab for certain content types and roles
I had the same issue and could solve that using template_preprocess_page(&amp;$variables).

Open template.php under [yoursite]/themes/[your-theme]

For example if you're using bartik theme and want to hide tabs (View and Edit) for Article content type for Editor role.

Paste the following code in your template.php

/**
 * Remove tabs on article content type
 */
function bartik_preprocess_page(&amp;$variables, $hook)
{
    if (!empty($variables['node']) &amp;&amp; $variables['node']-&gt;type == 'article' &amp;&amp; in_array('editor', $variables['user']-&gt;  roles))
    {
    $to_be_removed = array('node/%/edit', 'node/%/view');
    foreach ($variables['tabs'] as $group_key =&gt;$tab_group)
        {
            if (is_array($tab_group))
            {
                foreach ($tab_group as $key =&gt;$tab)
                {
                    if (isset($tab['#link']['path']) &amp;&amp; in_array($tab['#link']['path'], $to_be_removed))
                    {
                    unset($variables['tabs'][$group_key][$key]);
                    }
                }
            }
        }
    }
}


Clear your site cache and test.

This removes the View and Edit tabs on Article node pages for editor roles users. But they can access those pages via URL.

Hope this helps.