kikatsu has a point there. By default the game puts your id in the "sell" side of a ship purchase, so it is possible to buy a ship and NOT have the right id after wards.
Fix that "little" bug before you think about setting restrictions to ship purchase based on id's...