def role_users(request, role):
    """ Users receive a certain role """
    db = request.db
    if type(role) == str:
        doc = db.doc.find_one({'_id': role}, {'users': 1})
    else:
        doc = db.doc.find_one({'_id': {'$in': role}}, {'users': 1})
    return doc['users'].keys()
