Lines 34-39
use Koha::AuthorisedValueCategories;
Link Here
|
34 |
use Koha::AuthorisedValues; |
34 |
use Koha::AuthorisedValues; |
35 |
use Koha::MarcSubfieldStructures; |
35 |
use Koha::MarcSubfieldStructures; |
36 |
use Koha::Exception; |
36 |
use Koha::Exception; |
|
|
37 |
use Koha::BiblioFrameworks; |
37 |
|
38 |
|
38 |
use MARC::Field; |
39 |
use MARC::Field; |
39 |
use MARC::Record; |
40 |
use MARC::Record; |
Lines 1887-1893
subtest 'opac_summary_html' => sub {
Link Here
|
1887 |
|
1888 |
|
1888 |
subtest 'can_be_edited() tests' => sub { |
1889 |
subtest 'can_be_edited() tests' => sub { |
1889 |
|
1890 |
|
1890 |
plan tests => 9; |
1891 |
plan tests => 11; |
1891 |
|
1892 |
|
1892 |
$schema->storage->txn_begin; |
1893 |
$schema->storage->txn_begin; |
1893 |
|
1894 |
|
Lines 1918-1923
subtest 'can_be_edited() tests' => sub {
Link Here
|
1918 |
my $fa_biblio = $builder->build_sample_biblio( { frameworkcode => 'FA' } ); |
1919 |
my $fa_biblio = $builder->build_sample_biblio( { frameworkcode => 'FA' } ); |
1919 |
my $fa_patron = $builder->build_object( { class => 'Koha::Patrons', value => { flags => 0 } } ); |
1920 |
my $fa_patron = $builder->build_object( { class => 'Koha::Patrons', value => { flags => 0 } } ); |
1920 |
|
1921 |
|
|
|
1922 |
my $is_fa_framework = |
1923 |
$builder->build_object( { class => 'Koha::BiblioFrameworks', value => { is_fast_add => 1 } } ); |
1924 |
my $is_fa_biblio = $builder->build_sample_biblio( { frameworkcode => $is_fa_framework->frameworkcode } ); |
1925 |
|
1921 |
# Add editcatalogue => edit_catalog subpermission |
1926 |
# Add editcatalogue => edit_catalog subpermission |
1922 |
$builder->build( |
1927 |
$builder->build( |
1923 |
{ |
1928 |
{ |
Lines 1930-1938
subtest 'can_be_edited() tests' => sub {
Link Here
|
1930 |
} |
1935 |
} |
1931 |
); |
1936 |
); |
1932 |
|
1937 |
|
1933 |
ok( !$biblio->can_be_edited($fa_patron), "Fast add permissions are not enough" ); |
1938 |
ok( !$biblio->can_be_edited($fa_patron), "Fast add permissions are not enough" ); |
1934 |
ok( $fa_biblio->can_be_edited($fa_patron), "Fast add user can edit FA records" ); |
1939 |
ok( $fa_biblio->can_be_edited($fa_patron), "Fast add user can edit FA records" ); |
1935 |
ok( $fa_biblio->can_be_edited($patron), "edit_catalogue user can edit FA records" ); |
1940 |
ok( $fa_biblio->can_be_edited($patron), "edit_catalogue user can edit FA records" ); |
|
|
1941 |
ok( $is_fa_biblio->can_be_edited($fa_patron), "Fast add user can edit is_fast_add records" ); |
1942 |
ok( $is_fa_biblio->can_be_edited($patron), "edit_catalogue user can edit is_fast_add records" ); |
1936 |
|
1943 |
|
1937 |
# Mock the record source doesn't allow direct editing |
1944 |
# Mock the record source doesn't allow direct editing |
1938 |
$source_allows_editing = 0; |
1945 |
$source_allows_editing = 0; |
1939 |
- |
|
|