From ae96239156630abaf59b876b8a70df15cdfda201 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tadeusz=20=E2=80=9Etadzik=E2=80=9D=20So=C5=9Bnierz?= Date: Thu, 10 Apr 2025 11:41:09 +0200 Subject: [PATCH] Implment public_read_lists for ILL::Request and ::Attribute --- Koha/ILL/Request.pm | 12 ++++++++++++ Koha/ILL/Request/Attribute.pm | 4 ++++ Koha/REST/V1/ILL/Requests.pm | 1 + 3 files changed, 17 insertions(+) diff --git a/Koha/ILL/Request.pm b/Koha/ILL/Request.pm index 4bf239ce6a..2d211e4e1e 100644 --- a/Koha/ILL/Request.pm +++ b/Koha/ILL/Request.pm @@ -2017,6 +2017,18 @@ sub TO_JSON { return $object; } +=head3 public_read_list + +This method returns the list of publicly readable database fields for both API and UI output purposes + +=cut + +sub public_read_list { + return [qw( + illrequest_id backend status extended_attributes placed updated + )]; +} + =head2 Internal methods =head3 to_api_mapping diff --git a/Koha/ILL/Request/Attribute.pm b/Koha/ILL/Request/Attribute.pm index a761ab8c62..3f1bc4e8c8 100644 --- a/Koha/ILL/Request/Attribute.pm +++ b/Koha/ILL/Request/Attribute.pm @@ -58,6 +58,10 @@ sub request { return Koha::ILL::Request->_new_from_dbic( $self->_result->illrequest ); } +sub public_read_list { + return [qw(backend illrequest_id readonly type value)]; +} + =head2 Internal methods =head3 _type diff --git a/Koha/REST/V1/ILL/Requests.pm b/Koha/REST/V1/ILL/Requests.pm index 38d008045a..828420e0f9 100644 --- a/Koha/REST/V1/ILL/Requests.pm +++ b/Koha/REST/V1/ILL/Requests.pm @@ -61,6 +61,7 @@ sub list { sub patron_list { my $c = shift->openapi->valid_input or return; my $user = $c->stash('koha.user'); + $c->stash(is_public => 1); if ($user->borrowernumber != $c->param('patron_id') and !$user->is_superlibrarian) { return $c->render( -- 2.47.2