def get_object_if_current_user_has_read_permissions(object_id):
    user_id = flask_login.current_user.id
    try:
        permissions = get_user_object_permissions(object_id, user_id)
    except ObjectDoesNotExistError:
        return None
    if (Permissions.READ not in permissions):
        return None
    return get_object(object_id)
def get_object_if_current_user_has_read_permissions(object_id):
    user_id = flask_login.current_user.id
    try:
        permissions = get_user_object_permissions(object_id, user_id)
    except ObjectDoesNotExistError:
        return None
    if (Permissions.READ not in permissions):
        return None
    return get_object(object_id)