def METHOD_NAME(readonly_pg_repo):
    sample_object = readonly_pg_repo.images["latest"].get_table("fruits").objects[0]
    assert sample_object is not None
    # Try to impersonate the owner of the "otheruser" namespace and add a different external link to
    # an object that they own.
    with pytest.raises(ProgrammingError) as e:
        readonly_pg_repo.objects.register_object_locations([(sample_object, "fake_location", "S3")])
    assert "You do not have sufficient permissions on this namespace!" in str(e.value)