Bug 39600: Implement public_read_lists for ILL::Request and ::Attribute

Sponsored-by: Wiko <https://www.wiko-berlin.de/>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
Tadeusz „tadzik” Sośnierz 2025-04-10 11:41:09 +02:00 committed by Katrin Fischer
parent 44743bc3c7
commit 4929170536
No known key found for this signature in database
GPG Key ID: 0EF6E2C03357A834
3 changed files with 17 additions and 0 deletions

View File

@ -2139,6 +2139,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

View File

@ -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

View File

@ -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(