Add a condition to show menu link in YML
you can add custom access on route_name: double_vue_klesia.backuser.switch

double_vue_klesia.backuser.switch:
  path: '/path-of-you'
  defaults:
    _form:  '\Drupal\my_module\Form\DemoForm'
    _title: 'title'
  requirements:
    _custom_access: '\Drupal\my_module\Controller\ApplicationController::accessCustom'


Inside \Drupal\my_module\Controller\ApplicationController:

 /**
   * Check user has permission.
   *
   * @return \Drupal\Core\Access\AccessResult
   */
  public function accessCustom() {
    if (if (\Drupal::service('userswitch')-&gt;isSwitchUser())) {
      return AccessResult::allowed();
    }
    return AccessResult::forbidden();
  }