From 83c42e9820f10d44abd0fd79976846ee8bfc1382 Mon Sep 17 00:00:00 2001 From: Zacharias Zacharodimos Date: Tue, 10 Oct 2023 15:57:19 +0200 Subject: [PATCH] search-versions: apply permission to search deleted records --- invenio_rdm_records/services/config.py | 2 +- invenio_rdm_records/services/services.py | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/invenio_rdm_records/services/config.py b/invenio_rdm_records/services/config.py index beb884172..2047c39cd 100644 --- a/invenio_rdm_records/services/config.py +++ b/invenio_rdm_records/services/config.py @@ -169,7 +169,7 @@ class RDMSearchVersionsOptions(SearchVersionsOptions, SearchOptionsMixin): """Search options for record versioning search.""" params_interpreters_cls = [ - StatusParam + PublishedRecordsParam ] + SearchVersionsOptions.params_interpreters_cls diff --git a/invenio_rdm_records/services/services.py b/invenio_rdm_records/services/services.py index 1332217f6..f6abc6e87 100644 --- a/invenio_rdm_records/services/services.py +++ b/invenio_rdm_records/services/services.py @@ -411,6 +411,20 @@ def search_drafts( **kwargs, ) + def search_versions( + self, identity, id_, params=None, search_preference=None, expand=False, **kwargs + ): + """Search for published records matching the querystring.""" + return super().search_versions( + identity, + id_, + params, + search_preference, + expand, + permission_action="read_deleted", + **kwargs, + ) + # # Base methods, extended with handling of deleted records #