https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #203 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 211511 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211511&action=edit Bug 42383: Add Koha::Module::Policy framework This patch adds a module policy framework that exposes per-module capabilities to the UI. It replaces the pattern of dedicated GET /config endpoints (like GET /erm/config) with a session-scoped mechanism. A module policy is the intersection of system preferences (feature toggles), user permissions and library context. It is a plain JSON structure: an envelope with the module name, a 'global' block with the keys common to all modules, and the module specific keys under the module name: { module => 'checkin', global => { audio_alerts => true, ... }, checkin => { exempt_fine => false, ... }, } The page is bootstrapped with the policy, and the API returns it in the error object when it refuses a request because of it, so the client can refresh the UI. The server remains authoritative: the policy is informational, not an access token. Components: - Koha::Module::Policy: base class with new(), module(), to_hashref() and scope() - Koha::Module::Policy::Checkin: check-in module policy covering fines, holds, recalls, transfers, display and blockers Test plan: 1. Apply patch 2. Run: $ ktd --shell k$ prove t/db_dependent/Koha/Module/Policy.t \ t/db_dependent/Koha/Module/Policy/Checkin.t => SUCCESS: Tests pass! 3. Sign off :-D Assisted-by: Sonnet 4.6 (Anthropic) Assisted-by: Opus 5.5 (Anthropic) Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.