In loco parentis
The legal term in loco parentis is Latin for "in the place of a parent" and refers to the legal responsibility of a person or organization, regarding a child, to take on some of the functions and responsibilities of a parent, usually temporarily and in the absence of the child's parents. For example, school teachers are given some areas of responsibility in which they act in loco parentis.
Other persons in in loco parentis situations may include babysitters, older siblings in the role of babysitters, grandparents and guardians, as well as any person acting by, through, or under the direction of a court with jurisdiction over the child, and anyone who has express or implied consent of the child's parent or parents.
A person with in loco parentis authority is temporarily given some of the rights and responsibilities of the child's parents. These can include the right to impose punishment on the child when felt necessary. In countries where corporal punishment of children is allowed, persons in a in loco parentis situation may be legally permitted to give the child under their supervision a spanking, which they would not be allowed to in other situations.