From 6b135be07b43aff56eb209906e7150ba9a61ba59 Mon Sep 17 00:00:00 2001 From: David Manthey Date: Tue, 12 Nov 2024 15:03:19 -0500 Subject: [PATCH] Fix an issue searching for annotation metadata If a user has permission to view an annotation but not the item, a 403 was percolated to the UI --- CHANGELOG.md | 4 ++++ girder/girder_large_image/__init__.py | 7 ++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 53e282653..e9fc22261 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,10 @@ - Openslide now requires the binary wheel on appropriate platforms ([#1709](../../pull/1709), [#1710](../../pull/1710)) +### Bug Fixes + +- Fix an issue searching for annotation metadata on items that a user doesn't have permissions to view ([#1723](../../pull/1723)) + ## 1.30.2 ### Features diff --git a/girder/girder_large_image/__init__.py b/girder/girder_large_image/__init__.py index fcf98ae5d..95891c2a4 100644 --- a/girder/girder_large_image/__init__.py +++ b/girder/girder_large_image/__init__.py @@ -428,7 +428,12 @@ def metadataSearchHandler( # noqa if id in foundIds: continue foundIds.add(id) - entry = resultModelInst.load(id=id, user=user, level=level, exc=False) + try: + entry = resultModelInst.load(id=id, user=user, level=level, exc=False) + except Exception: + # We might have permission to view an annotation but not + # the item + continue if entry is not None and offset: offset -= 1 continue