In a real military they probably wouldn't have allowed it. Starfleet on the other hand is more like a quasi-military. They see themselves as explorers and scientists who moonlight as the military. And Cassidy was a private citizen who served her time, second chances and that good stuff. Plus they had to have been watching her.