Lines 1744-1750
subtest 'opac_summary_html' => sub {
Link Here
|
1744 |
|
1744 |
|
1745 |
subtest 'can_be_edited() tests' => sub { |
1745 |
subtest 'can_be_edited() tests' => sub { |
1746 |
|
1746 |
|
1747 |
plan tests => 6; |
1747 |
plan tests => 8; |
1748 |
|
1748 |
|
1749 |
$schema->storage->txn_begin; |
1749 |
$schema->storage->txn_begin; |
1750 |
|
1750 |
|
Lines 1772-1777
subtest 'can_be_edited() tests' => sub {
Link Here
|
1772 |
|
1772 |
|
1773 |
ok( $biblio->can_be_edited($patron), "Patron with 'edit_catalogue' can edit" ); |
1773 |
ok( $biblio->can_be_edited($patron), "Patron with 'edit_catalogue' can edit" ); |
1774 |
|
1774 |
|
|
|
1775 |
my $fa_biblio = $builder->build_sample_biblio( { frameworkcode => 'FA' } ); |
1776 |
my $fa_patron = $builder->build_object( { class => 'Koha::Patrons', value => { flags => 0 } } ); |
1777 |
|
1778 |
# Add editcatalogue => edit_catalog subpermission |
1779 |
$builder->build( |
1780 |
{ |
1781 |
source => 'UserPermission', |
1782 |
value => { |
1783 |
borrowernumber => $fa_patron->id, |
1784 |
module_bit => 9, # editcatalogue |
1785 |
code => 'fast_cataloging', |
1786 |
}, |
1787 |
} |
1788 |
); |
1789 |
|
1790 |
ok( !$biblio->can_be_edited($fa_patron), "Fast add permissions are not enough" ); |
1791 |
ok( $fa_biblio->can_be_edited($fa_patron), "Fast add user can edit FA records" ); |
1792 |
|
1775 |
# Mock the record source doesn't allow direct editing |
1793 |
# Mock the record source doesn't allow direct editing |
1776 |
$source_allows_editing = 0; |
1794 |
$source_allows_editing = 0; |
1777 |
ok( !$biblio->can_be_edited($patron), "Patron needs 'edit_locked_record' subpermission for locked records" ); |
1795 |
ok( !$biblio->can_be_edited($patron), "Patron needs 'edit_locked_record' subpermission for locked records" ); |
1778 |
- |
|
|