]> git.koha-community.org Git - koha.git/commit
Bug 26517: Avoid deleting patrons with permission
authorFridolin Somers <fridolin.somers@biblibre.com>
Wed, 23 Sep 2020 14:50:09 +0000 (16:50 +0200)
committerAndrew Fuerste-Henry <andrew@bywatersolutions.com>
Wed, 21 Apr 2021 19:37:27 +0000 (19:37 +0000)
commit11f271455d02f0649b3f0a7005ec3fb0e2137b00
tree19b63b06a4be161f1484349d0ea1fc166f8ccd9b
parent0529c92f7f409f2bd0965f66bf55afbdf1c5126c
Bug 26517: Avoid deleting patrons with permission

The patron deletion script misc/cronjobs/delete_patrons.pl uses C4::Member::GetBorrowersToExpunge() to get patrons that may be deleted.
This method filters patrons from a staff category.
I propose to also filter patrons having permission, so a staff member.
Some small libraries do not define a "staff" category and give permissions to regular patrons.

Test plan :
1) Create a patron on adult type category with expiry date in the past and permission to access staff interface
2) Without patch
3) Run delete script : ./src/misc/cronjobs/delete_patrons.pl -v --expired_before='$(date -I)'
4) You see the patron will be deleted
5) Apply patch
6) Run delete script : ./src/misc/cronjobs/delete_patrons.pl -v --expired_before='$(date -I)'
7) You dont see the patron

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit c4c33e532d4abeb66bbbafe0ab75797a8e801349)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 550577ed3a003231284f59ba3084a365a8ed04e5)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
C4/Members.pm