Lines 35-40
use Koha::AuthorisedValueCategories;
Link Here
|
35 |
use Koha::AuthorisedValues; |
35 |
use Koha::AuthorisedValues; |
36 |
use Koha::MarcSubfieldStructures; |
36 |
use Koha::MarcSubfieldStructures; |
37 |
use Koha::Exception; |
37 |
use Koha::Exception; |
|
|
38 |
use Koha::BiblioFrameworks; |
38 |
|
39 |
|
39 |
use MARC::Field; |
40 |
use MARC::Field; |
40 |
use MARC::Record; |
41 |
use MARC::Record; |
Lines 2086-2092
subtest 'opac_summary_html' => sub {
Link Here
|
2086 |
|
2087 |
|
2087 |
subtest 'can_be_edited() tests' => sub { |
2088 |
subtest 'can_be_edited() tests' => sub { |
2088 |
|
2089 |
|
2089 |
plan tests => 9; |
2090 |
plan tests => 11; |
2090 |
|
2091 |
|
2091 |
$schema->storage->txn_begin; |
2092 |
$schema->storage->txn_begin; |
2092 |
|
2093 |
|
Lines 2117-2122
subtest 'can_be_edited() tests' => sub {
Link Here
|
2117 |
my $fa_biblio = $builder->build_sample_biblio( { frameworkcode => 'FA' } ); |
2118 |
my $fa_biblio = $builder->build_sample_biblio( { frameworkcode => 'FA' } ); |
2118 |
my $fa_patron = $builder->build_object( { class => 'Koha::Patrons', value => { flags => 0 } } ); |
2119 |
my $fa_patron = $builder->build_object( { class => 'Koha::Patrons', value => { flags => 0 } } ); |
2119 |
|
2120 |
|
|
|
2121 |
my $is_fa_framework = |
2122 |
$builder->build_object( { class => 'Koha::BiblioFrameworks', value => { is_fast_add => 1 } } ); |
2123 |
my $is_fa_biblio = $builder->build_sample_biblio( { frameworkcode => $is_fa_framework->frameworkcode } ); |
2124 |
|
2120 |
# Add editcatalogue => edit_catalog subpermission |
2125 |
# Add editcatalogue => edit_catalog subpermission |
2121 |
$builder->build( |
2126 |
$builder->build( |
2122 |
{ |
2127 |
{ |
Lines 2129-2137
subtest 'can_be_edited() tests' => sub {
Link Here
|
2129 |
} |
2134 |
} |
2130 |
); |
2135 |
); |
2131 |
|
2136 |
|
2132 |
ok( !$biblio->can_be_edited($fa_patron), "Fast add permissions are not enough" ); |
2137 |
ok( !$biblio->can_be_edited($fa_patron), "Fast add permissions are not enough" ); |
2133 |
ok( $fa_biblio->can_be_edited($fa_patron), "Fast add user can edit FA records" ); |
2138 |
ok( $fa_biblio->can_be_edited($fa_patron), "Fast add user can edit FA records" ); |
2134 |
ok( $fa_biblio->can_be_edited($patron), "edit_catalogue user can edit FA records" ); |
2139 |
ok( $fa_biblio->can_be_edited($patron), "edit_catalogue user can edit FA records" ); |
|
|
2140 |
ok( $is_fa_biblio->can_be_edited($fa_patron), "Fast add user can edit is_fast_add records" ); |
2141 |
ok( $is_fa_biblio->can_be_edited($patron), "edit_catalogue user can edit is_fast_add records" ); |
2135 |
|
2142 |
|
2136 |
# Mock the record source doesn't allow direct editing |
2143 |
# Mock the record source doesn't allow direct editing |
2137 |
$source_allows_editing = 0; |
2144 |
$source_allows_editing = 0; |
2138 |
- |
|
|