Bug 35468: (follow-up) Test only the specific permission needed
The tests were granting circulation top-level permissions - we should be able to perform the actions with only 'manage_bookings'. This patch updates the tests to use the narrower permission. Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
parent
68ff5edb12
commit
a2005cd32c
1 changed files with 33 additions and 3 deletions
|
@ -194,7 +194,17 @@ subtest 'add() tests' => sub {
|
|||
my $librarian = $builder->build_object(
|
||||
{
|
||||
class => 'Koha::Patrons',
|
||||
value => { flags => 2**1 } # circulate flag = 1
|
||||
value => { flags => 0 } # no additional permissions
|
||||
}
|
||||
);
|
||||
$builder->build(
|
||||
{
|
||||
source => 'UserPermission',
|
||||
value => {
|
||||
borrowernumber => $librarian->borrowernumber,
|
||||
module_bit => 1,
|
||||
code => 'manage_bookings',
|
||||
},
|
||||
}
|
||||
);
|
||||
my $password = 'thePassword123';
|
||||
|
@ -273,7 +283,17 @@ subtest 'update() tests' => sub {
|
|||
my $librarian = $builder->build_object(
|
||||
{
|
||||
class => 'Koha::Patrons',
|
||||
value => { flags => 2**1 } # circulate flag = 1
|
||||
value => { flags => 0 } # no additional permissions
|
||||
}
|
||||
);
|
||||
$builder->build(
|
||||
{
|
||||
source => 'UserPermission',
|
||||
value => {
|
||||
borrowernumber => $librarian->borrowernumber,
|
||||
module_bit => 1,
|
||||
code => 'manage_bookings',
|
||||
},
|
||||
}
|
||||
);
|
||||
my $password = 'thePassword123';
|
||||
|
@ -371,7 +391,17 @@ subtest 'delete() tests' => sub {
|
|||
my $librarian = $builder->build_object(
|
||||
{
|
||||
class => 'Koha::Patrons',
|
||||
value => { flags => 2**1 } # circulate flag = 1
|
||||
value => { flags => 0 } # no additional permissions
|
||||
}
|
||||
);
|
||||
$builder->build(
|
||||
{
|
||||
source => 'UserPermission',
|
||||
value => {
|
||||
borrowernumber => $librarian->borrowernumber,
|
||||
module_bit => 1,
|
||||
code => 'manage_bookings',
|
||||
},
|
||||
}
|
||||
);
|
||||
my $password = 'thePassword123';
|
||||
|
|
Loading…
Reference in a new issue