In Matlock the U.S. Supreme Court laid out the so-called "co-occupant consent rule".
[1] The Supreme Court defined "common authority" as “mutual use of the property by persons generally having joint access or control for most purposes, so that it is reasonable to recognize that any of the co-inhabitants has the right to permit the inspection in his own right and that the others have assumed the risk that one of their number might permit the common area to be searched.
[3] When police arrived at Fernandez's apartment, they believed a suspect in a gang-related assault had just entered.
Fernandez refused to follow the police's directive to step away from his girlfriend and yelled "You don't have a right to come in here.
About an hour later the police came back to ask Fernandez's girlfriend for consent to search the apartment, which she gave.