Correct, it may be unconstitutional but I believe the case is still in court and for now it is still policy in NYC. Since it is current NYC city policy and has not yet been definitively ruled unconstitutional I think it's fair to call the practice "legal in NYC."
There is a law which supports it. But that law might well be unconstitutional, in which case the policy it supports is not necessarily legal.