https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #20 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 209553 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209553&action=edit Bug 42383: Add Koha::REST::Plugin::Policy This patch adds a Mojolicious plugin that provides the attach_module_policy helper to any API controller. Usage: $c->attach_module_policy('Checkin'); $c->attach_module_policy('Checkin', { library => $library_id }); The helper dynamically loads the appropriate Koha::Module::Policy subclass, generates the JWT, and sets the X-Koha-Module-Policy response header. This avoids duplicating policy attachment logic across controllers. Test plan: 1. Apply patch 2. Run: $ ktd --shell k$ prove t/db_dependent/api/v1/checkins.t => SUCCESS: Tests pass 3. Sign off :-D Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io> Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> -- You are receiving this mail because: You are watching all bug changes.