You can fly as you deem safe and the person is happy with
A common question for drone operators is how close can I fly to people that are 'involved' with my flight.
If a person is involved that means that they are aware that you are flying, are a part of your activity and happy for you to be flying your drone close and or over them.
There is no minimum distance required for involved people, however, you must ensure that you are conducting your flight safely and that your aircraft will not harm the person.
Our tips would be to avoid overflying a person for a significant length of time or unnecessarily and to ensure there is enough distance for the person to 'get out of the way' of the aircraft should the aircraft move uncontrollably or land unexpectedly.