Bug 29272: (QA follow-up) Category setup overrides syspref
This patch removes an early short-circuit we had, which wasn't correct regarding the OpacPasswordChange syspref. If a patron category is allowed to change password, it overrides the syspref. To test: 1. Tests still pass. Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
parent
d91d813e5c
commit
5b09620287
|
|
@ -90,14 +90,6 @@ sub set_public {
|
|||
my $body = $c->validation->param('body');
|
||||
my $patron_id = $c->validation->param('patron_id');
|
||||
|
||||
# short-circuit early
|
||||
unless ( C4::Context->preference('OpacPasswordChange') ) {
|
||||
return $c->render(
|
||||
status => 403,
|
||||
openapi => { error => "Configuration prevents password changes by unprivileged users" }
|
||||
);
|
||||
}
|
||||
|
||||
my $user = $c->stash('koha.user');
|
||||
|
||||
unless ( $user->borrowernumber == $patron_id ) {
|
||||
|
|
|
|||
|
|
@ -158,8 +158,7 @@ subtest 'set_public() (unprivileged user tests)' => sub {
|
|||
}
|
||||
)->status_is(403)->json_is(
|
||||
{
|
||||
error =>
|
||||
'Configuration prevents password changes by unprivileged users'
|
||||
error => 'Changing password is forbidden'
|
||||
}
|
||||
);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue