@@ -, +, @@ $ kshell k$ prove t/db_dependent/Koha/Object.t permissions and a know user/password combination GET http://kohadev-intra.myDNSname.org:8081/api/v1/biblio/245/checkouts Set the following header: x-koha-embed: patron Pick whatever biblio you want, actually. checkout is for a patron on the same library as Henry, and the other on a different one. containing the patron from Henry's library. The other, has the attribute set to 'null'. --- Koha/Object.pm | 3 +++ Koha/Patron.pm | 2 ++ 2 files changed, 5 insertions(+) --- a/Koha/Object.pm +++ a/Koha/Object.pm @@ -551,6 +551,9 @@ Returns a representation of the object, suitable for API output. sub to_api { my ( $self, $params ) = @_; + + return unless $self->accessible; + my $json_object = $self->TO_JSON; # Remove forbidden attributes if required --- a/Koha/Patron.pm +++ a/Koha/Patron.pm @@ -1766,6 +1766,8 @@ sub to_api { my $json_patron = $self->SUPER::to_api( $params ); + return unless $json_patron; + $json_patron->{restricted} = ( $self->is_debarred ) ? Mojo::JSON->true : Mojo::JSON->false; --