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:
Nick Clemens 2023-12-12 16:52:14 +00:00 committed by Katrin Fischer
parent 68ff5edb12
commit a2005cd32c
Signed by: kfischer
GPG key ID: 0EF6E2C03357A834

View file

@ -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';