As long as the plane is on the ground and not at the gate, everyone must be sitted. If the parking brake is set (delays, deicing) you may use the bathroom.
Approaching the gate is an especially bad time to use the bathroom because I have known a pilot or two to slam the brakes on to make the point that you are not to stand up until the seat belt sign is off.
I have also had many an FAA check ride where the inspector threatens to fine the flight attendants for 1. Not enforcing the seat belt sign and 2. Not forcing people to sit when they go to the bathroom and shouldn't be in there.
I don't make the rules, I just enforce them when necessary!