Lines 1355-1361
subtest 'Get shelves containing biblios' => sub {
Link Here
|
1355 |
}; |
1355 |
}; |
1356 |
|
1356 |
|
1357 |
subtest 'cannot_be_transferred' => sub { |
1357 |
subtest 'cannot_be_transferred' => sub { |
1358 |
plan tests => 12; |
1358 |
plan tests => 13; |
1359 |
|
1359 |
|
1360 |
# Three patrons and a deleted one |
1360 |
# Three patrons and a deleted one |
1361 |
my $staff = $builder->build_object( { class => 'Koha::Patrons', value => { flags => undef } } ); |
1361 |
my $staff = $builder->build_object( { class => 'Koha::Patrons', value => { flags => undef } } ); |
Lines 1379-1384
subtest 'cannot_be_transferred' => sub {
Link Here
|
1379 |
$public_list->cannot_be_transferred( { by => $staff->id, to => $receiver->id } ), 'unauthorized_transfer', |
1379 |
$public_list->cannot_be_transferred( { by => $staff->id, to => $receiver->id } ), 'unauthorized_transfer', |
1380 |
'Lacks permission' |
1380 |
'Lacks permission' |
1381 |
); |
1381 |
); |
|
|
1382 |
|
1383 |
# Give recipient MINIMUM permission |
1384 |
$builder->build( |
1385 |
{ |
1386 |
source => 'UserPermission', |
1387 |
value => { |
1388 |
borrowernumber => $receiver->id, |
1389 |
module_bit => 20, |
1390 |
code => 'edit_public_list_contents', |
1391 |
} |
1392 |
} |
1393 |
); |
1394 |
is( |
1395 |
$public_list->cannot_be_transferred( { by => $staff->id, to => $receiver->id } ), |
1396 |
'unauthorized_transfer', |
1397 |
'Recipient lacks necessary permissions to own public list' |
1398 |
); |
1399 |
|
1382 |
my $perms = $builder->build( |
1400 |
my $perms = $builder->build( |
1383 |
{ |
1401 |
{ |
1384 |
source => 'UserPermission', |
1402 |
source => 'UserPermission', |
Lines 1387-1395
subtest 'cannot_be_transferred' => sub {
Link Here
|
1387 |
} |
1405 |
} |
1388 |
} |
1406 |
} |
1389 |
); |
1407 |
); |
|
|
1408 |
|
1390 |
is( |
1409 |
is( |
1391 |
$public_list->cannot_be_transferred( { by => $staff->id, to => $receiver->id } ), 0, |
1410 |
$public_list->cannot_be_transferred( { by => $staff->id, to => $receiver->id } ), |
1392 |
'Minimum permission passes' |
1411 |
0, |
|
|
1412 |
'Recipient with minimum required permission can accept ownership' |
1393 |
); |
1413 |
); |
1394 |
$staff->flags(1)->store; |
1414 |
$staff->flags(1)->store; |
1395 |
is( |
1415 |
is( |
1396 |
- |
|
|