https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29275 --- Comment #53 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 212276 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=212276&action=edit Bug 29275: Restrict patron embeds on GET /biblios/{biblio_id}/checkouts This patch depends on bug 27184. This patch prepares the route for being used by the record's checkout history page (catalogue/issuehistory.pl), which only requires the catalogue permission and only displays who checked the items out to some users. Changes: - The route can be used by users with the catalogue permission - Embedding `patron` requires the view_patrons capability of the CheckoutHistory module policy (circulate_remaining_permissions). When listing checked in checkouts (circulation history), it also requires view_checkout_history (borrowers: view_checkout_history and the intranetreadinghistory system preference enabled). Otherwise a 403 with the `patron_embed_not_allowed` error_code is returned, carrying the current policy. - Add the `patron.library` and `issuer.library` embeds. Patrons the user cannot see (library groups, IndependentBranches) are redacted, but their library_id is kept. Embedding the library allows the UI to display 'A patron from <patron's library>' (see comment 37). Test plan: 1. Apply patch 2. Run: $ ktd --shell k$ yarn api:bundle k$ restart_all k$ prove t/db_dependent/api/v1/biblios.t \ xt/api.t => SUCCESS: Tests pass! 3. Sign off :-D Assisted-by: Opus 5.5 (Anthropic) -- You are receiving this mail because: You are watching all bug changes.