Picard and Riker never had a problem getting together with subordinates.
Picard was with Crusher and Daren.
Riker had Troi and was often seen flirting or at a table with other subordinate officers.
So the concept that Starfleet is high and mighty about fraternization with subordinates is baseless. Even a strickler like Picard loosened up now and again.
So the concept that Starfleet forbids it, is baseless even if it's frowned upon. Sisko never did, but he never had a random female officer of the week hit on him. To say nothing of his widower issues the first half of the show, and the abundance of civilians at his posting. Turns out he married one. So he can't really count.
Janeway could have hooked up with Chakotay or anyone else if she wanted, she actively -chose- not to based on her image concerns.