For example

Anyone who is formally entrusted with the care of a child is expected to act in loco parentis.