Alter views exposed form drupal 8
Following example unsets the filter average when user is NOT administrator, you can modify it to your specific case.

use Drupal\Core\Form\FormStateInterface;
function my_modulename_form_alter(&amp;$form, FormStateInterface $form_state, $form_id){

  $roles = \Drupal::currentUser()-&gt;getRoles();
  $is_user_admin = in_array("administrator", $roles);
  $is_exposed = $form_id == 'views_exposed_form';
  $is_filter_set = isset($form['average']);

  if ( $is_exposed &amp;&amp; $is_filter_set &amp;&amp; !$is_user_admin ) {
    unset($form['average']);
  }
}


If you want to unset only on a specific view exposed form use this condition

$is_our_view = $form["#id"] == "views-exposed-form-article-page-1";