This depends on the circumstances. The Supreme Court has ruled that any occupant of a residence can refuse consent, even if other roommates agree to a search. Unfortunately, you must be present in order to assert your refusal. For this reason, it’s important to make sure that your roommates understand their 4th Amendment rights in case something happens when you’re not around. You may want to talk to your roommates about how to handle police visits and reach an agreement about how to handle such situations just in case.

Clip from the DVD, BUSTED: The Citizen’s Guide to Surviving Police Encounters

As a general rule, police can obtain consent to search from anyone with control over the property. Someone who has a key, or whose name appears on the lease, can legally consent to a search of the property if no one else is present, or if no one else objects. If you rent the property, be advised that your landlord can also let the police in.

Finally, keep in mind that the courts often determine your “expectation of privacy” on a case-by-case basis. Keeping your room locked and maintaining control of your personal space can help protect you if a roommate ever lets police in. If your room is off-limits to your roommates and their friends, courts will often rule that it is off-limits to police as well.