Who was allowed in temples in the ancient Egypt?

Pharohas and the queen and all workers.There was indeed fake doors that would lead thefts into the jail's and stuff .