https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383
--- Comment #19 from Tomás Cohen Arazi (tcohen) <[email protected]> --- Created attachment 209552 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209552&action=edit Bug 42383: Add Koha::Module::Policy framework This patch adds a module policy framework that exposes per-module capabilities as signed JWTs in API response headers. This replaces the pattern of dedicated GET /config endpoints (like GET /erm/config) with a reactive, session-scoped mechanism. A module policy is the intersection of: - System preferences (feature toggles) - User permissions (what this staff member can do) - Library context (branch-specific configuration) The JWT is attached to every API response. The client decodes the payload to render appropriate UI controls. The server remains authoritative - the JWT is informational, not an access token. Components: - Koha::Module::Policy - Base class with new(), to_hashref(), as_jwt() - Koha::Module::Policy::Checkin - Checkin module policy with 19 keys 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. Tests cover: - Base class constructor validation - Abstract method enforcement - scope() derivation from class name - Permission-gated capabilities (exempt_fine, forgive_hold_fees) - Superlibrarian vs limited user - JWT generation and payload verification 4. Sign off :-D Signed-off-by: Tomás Cohen Arazi <[email protected]> Signed-off-by: Brendan Lawlor <[email protected]> -- You are receiving this mail because: You are watching all bug changes. _______________________________________________ Koha-bugs mailing list -- [email protected] To unsubscribe send an email to [email protected] website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
