Skip to content

Commit

Permalink
records: service: add permission check action as parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
yashlamba authored and slint committed Dec 7, 2023
1 parent 9c3ad46 commit bea86b6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions invenio_records_resources/services/records/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -366,11 +366,11 @@ def _create(
expand=expand,
)

def read(self, identity, id_, expand=False):
def read(self, identity, id_, expand=False, action="read"):
"""Retrieve a record."""
# Resolve and require permission
record = self.record_cls.pid.resolve(id_)
self.require_permission(identity, "read", record=record)
self.require_permission(identity, action, record=record)

# Run components
for component in self.components:
Expand Down

0 comments on commit bea86b6

Please sign in to comment.