The police may search your apartment if the person in charge of the premises gives permission. If you and your roommate share common areas (such as the kitchen and living room), your roommate can authorize a search of those areas. But your roommate cannot give permission to search your separate bedroom.
Similarly, your landlord cannot give permission to search your apartment. However, if the police can point to circumstances that would justify immediate entry -- such as the sound of a ferocious fight or the smell of burning marijuana -- they may enter without permission from anyone.