adjusts access for non-grouped entries

This commit is contained in:
msramalho
2025-10-14 12:25:32 +01:00
parent a48998223a
commit 8f779f5276
2 changed files with 4 additions and 3 deletions

View File

@@ -109,6 +109,7 @@ def test_search_archives_by_url(test_data, db_session):
)
== 16
)
# true READ will work for all groups or lack of groups
assert (
len(
crud.search_archives_by_url(
@@ -119,7 +120,7 @@ def test_search_archives_by_url(test_data, db_session):
False,
)
)
== 16
== 33
)
assert (
len(
@@ -131,7 +132,7 @@ def test_search_archives_by_url(test_data, db_session):
True,
)
)
== 16
== 33
)
# Jerry's archives are public

View File

@@ -76,7 +76,7 @@ def search_archives_by_url(
if read_public:
or_filters.append(models.Archive.public.is_(true()))
if read_groups is True:
or_filters.append(models.Archive.group_id.isnot(None))
or_filters.append(true())
else:
or_filters.append(models.Archive.group_id.in_(read_groups))
query = query.filter(or_(*or_filters))