A handy guide from The American Civil Liberties Union:
The right to join with fellow citizens in protest or peaceful assembly is critical to a functioning democracy. But it is also unfortunately true that governments and police can violate this right – through the use of mass arrests, illegal use of force, criminalization of protest, and other means intended to thwart free public expression… knowing your rights is the most powerful weapon you have against police abuse.