Lines 21-27
my $baskets = {
Link Here
|
21 |
} |
21 |
} |
22 |
}; |
22 |
}; |
23 |
|
23 |
|
24 |
my $userenv = {}; |
24 |
my $userenv = { flags => 0 }; |
|
|
25 |
|
26 |
sub BeSuperLibrarian { $userenv->{flags} = 1; } |
27 |
sub BeOrdinaryLibrarian { $userenv->{flags} = 0; } |
25 |
|
28 |
|
26 |
my $borrower = {}; |
29 |
my $borrower = {}; |
27 |
|
30 |
|
Lines 38-44
my $order3 = {
Link Here
|
38 |
$userenv->{branch} = 'B1'; |
41 |
$userenv->{branch} = 'B1'; |
39 |
|
42 |
|
40 |
# User can receive any orders thanks to his permissions |
43 |
# User can receive any orders thanks to his permissions |
41 |
ok( CanUserReceiveOrder($borrower, $order1, {superlibrarian => 1}) ); |
44 |
BeSuperLibrarian(); |
|
|
45 |
ok( CanUserReceiveOrder($borrower, $order1, {}) ); |
46 |
BeOrdinaryLibrarian(); |
47 |
|
42 |
ok( CanUserReceiveOrder($borrower, $order1, {acquisition => 1}) ); |
48 |
ok( CanUserReceiveOrder($borrower, $order1, {acquisition => 1}) ); |
43 |
ok( CanUserReceiveOrder($borrower, $order1, {acquisition => { order_receive_all => 1 }}) ); |
49 |
ok( CanUserReceiveOrder($borrower, $order1, {acquisition => { order_receive_all => 1 }}) ); |
44 |
|
50 |
|
Lines 56-62
ok( not CanUserReceiveOrder($borrower, $order3, {acquisition => { order_receive
Link Here
|
56 |
$userenv->{branch} = 'B2'; |
62 |
$userenv->{branch} = 'B2'; |
57 |
|
63 |
|
58 |
# User can receive any order thanks to his permissions |
64 |
# User can receive any order thanks to his permissions |
59 |
ok( CanUserReceiveOrder($borrower, $order1, {superlibrarian => 1}) ); |
65 |
BeSuperLibrarian(); |
|
|
66 |
ok( CanUserReceiveOrder($borrower, $order1, {}) ); |
67 |
BeOrdinaryLibrarian(); |
68 |
|
60 |
ok( CanUserReceiveOrder($borrower, $order1, {acquisition => 1}) ); |
69 |
ok( CanUserReceiveOrder($borrower, $order1, {acquisition => 1}) ); |
61 |
ok( CanUserReceiveOrder($borrower, $order1, {acquisition => { order_receive_all => 1 }}) ); |
70 |
ok( CanUserReceiveOrder($borrower, $order1, {acquisition => { order_receive_all => 1 }}) ); |
62 |
|
71 |
|
63 |
- |
|
|