"You're not allowed to rape" is a pretty strong example.
All roads lead to freedom. There can be no tyranny without freedom to tyrannize - there's just no way around it.
This is literally what law is. A social construct to codify (and enable the enforcement of) what is deemed moral vs amoral.
Which implies that someone else had the freedom to decide what's good for you. Society is just a bunch of other people.
You appear to be trying to paint some kind on complex philosophical picture where it just simply doesn't exist.
Law is the codification, and ratification, of what society deems ethical/moral behaviour.
Unless you are about to start declaring some magic creates law, no shit it comes from people.