Skip to content

Commit

Permalink
BWS-PKG - Bug 38094: (follow-up) edit_catalogue implies fast_cataloguing
Browse files Browse the repository at this point in the history
Signed-off-by: Tomas Cohen Arazi <[email protected]>
  • Loading branch information
tomascohen authored and kylemhall committed Oct 4, 2024
1 parent f26618a commit 6a3510b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 4 additions & 1 deletion Koha/Biblio.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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 } ) )
Expand Down
3 changes: 2 additions & 1 deletion t/db_dependent/Koha/Biblio.t
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 6a3510b

Please sign in to comment.