I remember one of my high school teachers, who right at the start of the term made his position very clear on this: If you have to go to the bathroom, you can go; just be quiet about it and try not to interrupt the class with your going and returning. Asking permission to use the bathroom, as though your basic biological functions were under someone else's authority, is something they do in the prison system. He wanted no part of that in a school.
Shame he was the only teacher like that.