FWIW I agree that *****-nilly toilet trips are not acceptable, but I also think that if a kid needs to go, it needs to go! I solve the issue by saying "Fine, but I'll time you, and then you can make up the time at breaktime / lunchtime / end of the day". Genuine cases will go, and then i will keep them for a token amount of time (normally long enough for the other kids to have seen that I've kept them back, then have left the room. I'll then say to the student "I'm not supposed to let you out in lessons - please make sure you go at breaktime or lunchtime in the future"). If they aren't genuine cases, the reply is usually "OK, I'll wait then..." and that's the end of that.