]> git.koha-community.org Git - koha.git/commit
Bug 29272: Make public password changing honour category constraints
authorTomas Cohen Arazi <tomascohen@theke.io>
Tue, 19 Oct 2021 13:29:55 +0000 (10:29 -0300)
committerKyle M Hall <kyle@bywatersolutions.com>
Fri, 29 Oct 2021 15:47:32 +0000 (11:47 -0400)
commit3d743c5f542764fae02541e04014f45145a5335d
treedec9bcc3bfe0fe129ad57c5d55618d94178de477
parentbb6e49203c2a532bd5c3481d39c46c2b3b553184
Bug 29272: Make public password changing honour category constraints

This patch makes the public API routes validate
$user->category->effective_change_password before allowing the change.

To test:
1. Apply the regression tests patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/api/v1/patrons_password.t
=> FAIL: Tests fail, it allows the first change instead of returning
         403.
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass!
5. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Koha/REST/V1/Patrons/Password.pm