Profile2 and profile fields by user role I have some profile fields created with the Profile2 module, which creates a main profile containing all the fields.
In the user/%/edit/main path, I see a new tab which displays a form to edit profile fields.  

I have also three user roles, ( e.g. role A, B and C), and I want to remove that menu path for the role C. Alternatively, I want to restrict the access to those profile fields by user role.  

Can I use the module Profile2 Privacy to achieve the goal?
I've done with hook_process_page() and removed the variable secondary_local_tasks before rendering to the template if the logged-in user is role C. No need additional module.

function mymodule_process_page(&amp;$vars, $hooks){
    global $user;
    if(array_key_exists(6, $user-&gt;roles) &amp;&amp; arg(0) == 'user' &amp;&amp; arg(2) == 'edit'){
        # if user role C, hide profile tab
        $vars['tabs']['#secondary'] = array();
        if(isset($vars['secondary_local_tasks'])){
            $vars['secondary_local_tasks'] = array();
        }
    }
}


I have also tried this from hook_preprocess_page(), but it did not work on the sky theme.
Related question is here : Menu local tasks and hook preprocess