This patch adds age restriction handling to the Koha namespace: - Koha::Biblio->age_restriction: metadata extractor that parses the agerestriction field using the AgeRestrictionMarker system preference. Returns the numeric age or undef. Uses single return with last pattern. - Koha::Policy::Biblio::AgeRestriction->check($biblio, $patron): policy class that evaluates whether a patron meets the age restriction. Returns a Koha::Result::Boolean (with payload on restriction). Test plan: 1. Apply this patch 2. Run: $ ktd --shell k$ prove t/db_dependent/Koha/Policy/Biblio/AgeRestriction.t => SUCCESS: Tests pass! 3. Sign off :-D Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk> |
||
|---|---|---|
| .. | ||
| Biblio | ||
| Patrons | ||
| Holds.pm | ||