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 <blawlor@clamsnet.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 664cbb5bc5)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
Kyle M Hall 2024-10-04 10:10:13 -04:00 committed by Lucas Gass
parent 1f34eff2e6
commit 0273b348f9
1 changed files with 3 additions and 1 deletions

View File

@ -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;
}