'Test the Connector works with a user with minimum privileges.'

def test_connector_minimum_privileges(self):

    if (not (db_user and db_password)):
        raise SkipTest('Need    to    set    a    user/password    to    test    this.')
    client = self.repl_set.client()
    minimum_user = 'read_local_and_included_databases'
    minimum_pwd = 'password'
    client.admin.add_user(minimum_user, minimum_pwd, roles=[{'role': 'read', 'db': 'test'}, {'role': 'read', 'db': 'wildcard'}, {'role': 'read', 'db': 'local'}])
    client.test.test.insert_one({'replicated': 1})
    client.test.ignored.insert_one({'replicated': 0})
    client.ignored.ignored.insert_one({'replicated': 0})
    client.wildcard.test.insert_one({'replicated': 1})
    conn = Connector(mongo_address=self.repl_set.primary.uri, auth_username=minimum_user, auth_key=minimum_pwd, namespace_options={'test.test': True, 'wildcard.*': True})
    conn.start()
    try:
        assert_soon(conn.doc_managers[0]._search)
    finally:
        conn.join()
