diff --git a/lib/galaxy/webapps/galaxy/api/folder_contents.py b/lib/galaxy/webapps/galaxy/api/folder_contents.py index da81e0229d8..66f66780fbe 100644 --- a/lib/galaxy/webapps/galaxy/api/folder_contents.py +++ b/lib/galaxy/webapps/galaxy/api/folder_contents.py @@ -98,7 +98,7 @@ class FolderContentsController(BaseAPIController, UsesLibraryMixin, UsesLibraryM # Access rights are checked on the dataset level, not on the ld or ldda level to maintain consistency dataset = content_item.library_dataset_dataset_association.dataset is_unrestricted = trans.app.security_agent.dataset_is_public(dataset) - if trans.user and trans.app.security_agent.dataset_is_private_to_user(trans, dataset): + if not is_unrestricted and trans.user and trans.app.security_agent.dataset_is_private_to_user(trans, dataset): is_private = True else: is_private = False