def METHOD_NAME(endpoint, visibility):
    endpoint_json = endpoint._get_json_by_id(
        endpoint._conn, endpoint.workspace, endpoint.id
    )
    if "custom_permission" not in endpoint_json["creator_request"]:
        pytest.skip("backend does not support new visibility")
    assert (
        endpoint_json["creator_request"]["custom_permission"]["collaborator_type"]
        == visibility._collaborator_type_str
    )
    assert (
        endpoint_json["creator_request"]["resource_visibility"]
        == visibility._visibility_str
    )