Koha-clms/members
Paul Derscheid c7b0455d5d
Bug 41946: Allow superlibrarians to set protected flag on patron creation
Since bug 36085, the protected flag in a patron account was removed from
the patron creation form, regardless of if the user is a superlibrarian.

- Hoist $logged_in_user lookup before the edit_form block
- Move superlibrarian capability checks after the block so they apply
  to all operations including patron creation

To test:
1. Sign in as a superlibrarian
2. Go to Patrons > New patron > choose any category
3. Without this patch: the "Protected" yes/no field is missing
   from the "Library management" section
4. Apply this patch
5. Repeat step 2
   - The "Protected" yes/no field is now visible
6. Create the patron with Protected set to "Yes"
7. Confirm the patron is saved as protected
8. Sign in as a non-superlibrarian with edit_borrowers permission
9. Repeat step 2
   - The "Protected" field should still be hidden
10. Edit an existing patron as superlibrarian
    - The "Protected" field is visible and functional
11. Edit an existing patron as non-superlibrarian
    - The "Protected" field is hidden
12. Sign off

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit bb16f1dd29)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2026-09-11 12:35:23 +00:00
..
accountline-details.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
alert-subscriptions.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
apikeys.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
boraccount.pl Bug 41761: Do not update accountlines.date when editing a note 2026-04-13 08:47:22 +01:00
cancel-charge.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
default_messageprefs.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
deletemem.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
discharge.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
discharges.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
files.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
holdshistory.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
housebound.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
ill-requests.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
mancredit.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
maninvoice.pl Bug 41076: [25.11.x] Adjust perl tidiness for v20250105 2026-03-16 13:23:08 +00:00
member-flags.pl Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
member-password.pl Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
member.pl Bug 41040: Prevent form submission if no filters have been selected 2026-03-23 13:15:33 +00:00
memberentry.pl Bug 41946: Allow superlibrarians to set protected flag on patron creation 2026-09-11 12:35:23 +00:00
members-home.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
members-update-do.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
members-update.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
merge-patrons.pl Bug 35830: Add merge_borrowers subpermission 2025-10-31 15:26:14 -06:00
mod_debarment.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
moremember.pl Bug 40886: Ensure patron messages display in proper chronological order 2025-10-06 09:15:22 -06:00
notices.pl Bug 41076: [25.11.x] Adjust perl tidiness for v20250105 2026-03-16 13:23:08 +00:00
patronimage.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
pay.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
paycollect.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
print_overdues.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
printfeercpt.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
printinvoice.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
printnotice.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
printslip.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
purchase-suggestions.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
readingrec.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
recallshistory.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
routing-lists.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
setstatus.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
statistics.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
summary-print.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
two_factor_auth.pl Bug 30724: Fix selenium tests - fix logic if no borrowernumber passed 2025-10-16 15:20:16 -06:00
update-child.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00