Bug 38094: (follow-up) edit_catalogue implies fast_cataloguing

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 51055d892b)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
Tomas Cohen Arazi 2024-10-04 11:41:12 -03:00 committed by Lucas Gass
parent 0273b348f9
commit 3ffb91aa07
2 changed files with 6 additions and 2 deletions

View File

@ -263,7 +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';
my $editcatalogue =
$self->frameworkcode eq 'FA'
? [ 'fast_cataloging', 'edit_catalogue' ]
: 'edit_catalogue';
return (
( $self->metadata->source_allows_editing && $patron->has_permission( { editcatalogue => $editcatalogue } ) )

View File

@ -1613,7 +1613,7 @@ subtest 'opac_summary_html' => sub {
subtest 'can_be_edited() tests' => sub {
plan tests => 8;
plan tests => 9;
$schema->storage->txn_begin;
@ -1658,6 +1658,7 @@ subtest 'can_be_edited() tests' => sub {
ok( !$biblio->can_be_edited($fa_patron), "Fast add permissions are not enough" );
ok( $fa_biblio->can_be_edited($fa_patron), "Fast add user can edit FA records" );
ok( $fa_biblio->can_be_edited($patron), "edit_catalogue user can edit FA records" );
# Mock the record source doesn't allow direct editing
$source_allows_editing = 0;