I have managed to hide certain fields for certain roles programmatically in Drupal 8 using function module_name_form_node_form_alter(array &$form, FormStateInterface &$form_state, $form_id)
.
The matter is that what I managed to hide such fields in the "Edit" tab, but I would also like to do the same in the "View" tab. What I intend to do is to hide certain fields depending on their machine name and the role of the user logged.
Do any of you know which hook should I use for that?