They were allowed to leave. As they exit into the hallway, Tonks had returned with the bag and Hermione rushed ahead and swiped it from the woman and she quickly looks through. Of course their weapons weren't going to be in it. She however was happy, zipping it back up.