During reconstruction, many southern states passed laws that restricted African Americans from traveling without a permit, owning firearms, or from gathering in the streets after nightfall. These were known as Black Codes.
They were passed in America after the Civil War - in 1865 and 1866.