Skip to content

Commit

Permalink
search-versions: apply permission to search deleted records
Browse files Browse the repository at this point in the history
  • Loading branch information
zzacharo committed Oct 10, 2023
1 parent 1a7ff75 commit 048a79e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion invenio_rdm_records/services/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ class RDMSearchVersionsOptions(SearchVersionsOptions, SearchOptionsMixin):
"""Search options for record versioning search."""

params_interpreters_cls = [
StatusParam
PublishedRecordsParam
] + SearchVersionsOptions.params_interpreters_cls


Expand Down
14 changes: 14 additions & 0 deletions invenio_rdm_records/services/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
#
Expand Down

0 comments on commit 048a79e

Please sign in to comment.