If you are talking about photos inside a port this is probably the case, for example Lyttelton NZ.
But I cannot believe you cannot take photos from a public vantage point for example a park, or a road, beach etc in Italy or anywhere else with the possible exception of countries like Somalia,Syria,Iran for example.
It is the norm for all photogrpahy to be banned in most ports from what I have seen and heard.