For more than a year, the New York Police Department had ready access to a database that held the scanned identification document of every person who entered a large SoHo nightclub, whether those people were engaged in criminal activity or simply socializing with friends, according to a lawsuit.

The club, Greenhouse, has had a history of violence and other problems. Faced with the prospect of being shut down, the owners signed an agreement with the Police Department in March 2011 that required them to scan the ID of everyone who passed through the club’s doors. The data was to be kept for at least 30 days, and provided to the police upon request.

Maintaining a database of all clientele and making it available to law enforcement officers at will is an unusual step that raises privacy concerns for those customers, said Donna Lieberman, the executive director of the New York Civil Liberties Union.