Bug 35830

Summary: Add separate permission for Merging Patrons
Product: Koha Reporter: Rebecca Coert <rcoert>
Component: CirculationAssignee: Brendan Lawlor <blawlor>
Status: Needs Signoff --- QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: blawlor, chanel.wheeler, eric, gmcharlt, kyle, mspinney
Version: unspecified   
Hardware: All   
OS: All   
GIT URL: Change sponsored?: ---
Patch complexity: Small patch Documentation contact:
Documentation submission: Text to go in the release notes:
Version(s) released in:
Circulation function:
Attachments: Bug 35830: Add merge_borrowers subpermission
Bug 35830: Add merge_borrowers subpermission
Bug 35830: Add merge_borrowers subpermission

Description Rebecca Coert 2024-01-17 16:13:49 UTC
Currently, the ability to Merge Patrons is lumped under the "Add, modify, and view patron information" (edit_borrowers).  Merging patron records is more powerful than the ability to add/modify/view a patron record. 

My request is to have this as a separate permission, similar to that of delete_borrowers.
Comment 1 Chanel Wheeler 2024-10-08 15:30:27 UTC
+1
Comment 2 Brendan Lawlor 2025-09-08 20:28:44 UTC
*** Bug 38754 has been marked as a duplicate of this bug. ***
Comment 3 Brendan Lawlor 2025-09-09 14:13:13 UTC
Created attachment 186301 [details] [review]
Bug 35830: Add merge_borrowers subpermission

Merging patrons only required edit_borrowers permission
but would result in a patron deletion.

This patch requires a new merge_borrowers subpermission

To test:
1. Give a patron the following permissions
    catalogue, edit_borrowers, list_borrowers
2. Log into the staff interface as the patron
3. Do a patron search and select 2 patrons
4. Click merge patron - success - a patron got deleted
5. Apply patch, updatedatabase and restart_all
6. Repeat steps 3 and 4 - you can't
7. Add the new permission for merge_borrowers
8. Repeat steps 3 and 4 - now you can
9. prove t/Koha/Auth/Patrons.t
Comment 4 Brendan Lawlor 2025-09-09 14:23:06 UTC
Created attachment 186302 [details] [review]
Bug 35830: Add merge_borrowers subpermission

Merging patrons only required edit_borrowers permission
but would result in a patron deletion.

This patch requires a new merge_borrowers subpermission

To test:
1. Give a patron the following permissions
    catalogue, edit_borrowers, list_borrowers
2. Log into the staff interface as the patron
3. Do a patron search and select 2 patrons
4. Click merge patron - success - a patron got deleted
5. Apply patch, updatedatabase and restart_all
6. Repeat steps 3 and 4 - you can't
7. Add the new permission for merge_borrowers
8. Repeat steps 3 and 4 - now you can
9. prove t/Koha/Auth/Patrons.t

Sponsored-by: CLAMS
Comment 5 Brendan Lawlor 2025-09-09 16:20:53 UTC
Setting to needs sign off for feedback.

I know I need to add the atomic update in a separate commit. 

I think this might also need to update the database to give the new merge_borrowers permission to everyone who currently has the delete_borrowers permission.

Or should it just give merge_borrowers to everyone with edit_borrowers because that's the current way it is?
Comment 6 Brendan Lawlor 2025-09-29 16:08:07 UTC
Created attachment 187060 [details] [review]
Bug 35830: Add merge_borrowers subpermission

Merging patrons only required edit_borrowers permission
but would result in a patron deletion.

This patch requires a new merge_borrowers subpermission

To test:
1. Give a patron the following permissions
    catalogue, edit_borrowers, list_borrowers
2. Log into the staff interface as the patron
3. Do a patron search and select 2 patrons
4. Click merge patron - success - a patron got deleted
5. Apply patch, updatedatabase and restart_all
6. Repeat steps 3 and 4 - you can't
7. Add the new permission for merge_borrowers
8. Repeat steps 3 and 4 - now you can
9. prove t/Koha/Auth/Patrons.t

Sponsored-by: CLAMS
Comment 7 Brendan Lawlor 2025-09-29 16:15:01 UTC
I added an insert statement to the atomic update to add the merge_borrowers permission for all users who currently have the edit_borrowers permission 

This makes the behavior for for existing installations consistent with the current functionality.