If you have one lifeline, the racing rules allow you to put your legs under it and outside the boat but your upper body must be inside. If you have two lifelines made of wire, then you can put your torso under the upper lifeline. If there's something you need to do, like free a line, you can be anywhere you need to when you do. Hanging from your ankles off the side of a boat on it's ear to cut a line wrapped on the keel would be ok.
But that's when racing. When not racing I haven't heard of any rules about where you can be, other than "teak surfing", which is being dragged behind a boat while hanging on to the swim platform. Not sure if that one even applies to sail boats not under power, since it's the prop and the exhaust that cause the danger. But local town councils LOVE to make up laws. Maybe someone, probably a child, got hurt on or near a boat. So now the politicos have to make some law so they can act like they're doing something. Think of the children! You must pass my law! The law itself is nearly irrelevant. Just pick some minority, like boaters, and create some regulation that will only bother that minority. So you get some local law that no one may be past the railing or lifeline in any way.