Autocomplete field, filter

Hey there in a kind I have a field_dependent area (entity referral) with autocomplete widget.
The entity referral is linked to a sight.
Depending upon the individual (” manager” or “driver”), it ought to show just the staff members connected to the individual (for manager all, for driver just those connected to him)
In form_alter I was considering placing the code that filterings system the staff members yet I do not recognize if this is the ideal option.
Conversely transform the widget right into pick

Drupal variation: