Yes, this is legal. Employment is employment at will: that means,among other things, that your employer controls when you work and you have no guaranty of hours or work. It also means that your employer can discipline your for essentially any reason. So your employer could legally choose to send you home if the supervisor thought you were taking too long, wasting time, or being insubordinate with your response to her.There is no legal right to go to the bathroom whenever you want at work.