Minecraft wiki entry for Command_blocks_and_functions, associated text: By using a condition such as /execute if entity @p[distance=..5,name=<owner>] run <command>, the command block can detect a door's owner within a certain radius and open a door for them, and only for them.