From 664cbb5bc5d5173a517a6d2206d62665a8b22792 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Fri, 4 Oct 2024 10:10:13 -0400 Subject: [PATCH] Bug 38094: Allow librarians with fast add permissions to edit existing fast add records The ability to create fast add records was fixed on bug 38076, but they still cannot be edited after they are saved. Test Plan: 1) Create a librarian with only fast add cataloging permissions 2) Create a fast add record, save it 3) Attempt to edit that record, you cannot! 4) Apply this patch 5) Restart all the things! 6) Attempt to edit that record, you can! 7) Attempt to edit a non-FA record, you cannot! Signed-off-by: Brendan Lawlor Signed-off-by: Tomas Cohen Arazi Signed-off-by: Katrin Fischer --- Koha/Biblio.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Koha/Biblio.pm b/Koha/Biblio.pm index 0f9d4cd877..5ef19b48c9 100644 --- a/Koha/Biblio.pm +++ b/Koha/Biblio.pm @@ -263,8 +263,10 @@ sub can_be_edited { Koha::Exceptions::MissingParameter->throw( error => "The patron parameter is missing or invalid" ) unless $patron && ref($patron) eq 'Koha::Patron'; + my $editcatalogue = $self->frameworkcode eq 'FA' ? 'fast_cataloging' : 'edit_catalogue'; + return ( - ( $self->metadata->source_allows_editing && $patron->has_permission( { editcatalogue => 'edit_catalogue' } ) ) + ( $self->metadata->source_allows_editing && $patron->has_permission( { editcatalogue => $editcatalogue } ) ) || $patron->has_permission( { editcatalogue => 'edit_locked_records' } ) ) ? 1 : 0; } -- 2.39.5