I doubt anything the PM said was illegal, the real question is, was it ethical. If JWR felt she was pressured to do something she didn't think was ethical, she is did the right thing.
There’s actually no evidence she did the right thing, either. She was quite happy to continue until she was ‘demoted’.