def METHOD_NAME(
    running_app,
    search_clear,
    client,
    uploader,
    headers,
    minimal_record,
    users,
):
    client = uploader.login(client)
    file_id = "test_image.png"
    recid = publish_record_with_images(
        client, file_id, minimal_record, headers, restricted_files=True
    )
    client = uploader.logout(client)
    response = client.get(f"/iiif/record:{recid}/manifest")
    # TODO: should we return only the parts the user has access to?
    assert response.status_code == 403
    # Log in user and try again
    client = uploader.login(client)
    response = client.get(f"/iiif/record:{recid}/manifest")
    assert response.status_code == 200