Koha-clms/members
Paul Derscheid bb16f1dd29
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>
2026-08-10 14:56:12 -06:00
..
accountline-details.pl
…
alert-subscriptions.pl
…
apikeys.pl Bug 20638: Update apikeys.pl and template with proper exception handling 2026-01-22 09:26:01 -07:00
boraccount.pl Bug 41761: Do not update accountlines.date when editing a note 2026-02-26 09:04:16 -07:00
cancel-charge.pl
…
default_messageprefs.pl
…
deletemem.pl
…
discharge.pl
…
discharges.pl
…
files.pl
…
holdshistory.pl
…
housebound.pl
…
ill-requests.pl
…
mancredit.pl
…
maninvoice.pl Bug 41076: Adjust our perl tidiness for v20250105 2026-02-05 09:03:51 -07:00
member-flags.pl Bug 42085: Slim down members/member-flags.pl cud-newflags block 2026-04-16 15:54:08 -06:00
member-password.pl
…
member.pl Bug 41040: Prevent form submission if no filters have been selected 2026-02-25 07:36:55 -07:00
memberentry.pl Bug 41946: Allow superlibrarians to set protected flag on patron creation 2026-08-10 14:56:12 -06:00
members-home.pl
…
members-update-do.pl
…
members-update.pl
…
merge-patrons.pl Bug 30303: (follow-up) Copy values from merge results instead of CGI 2026-05-01 11:04:27 -06:00
mod_debarment.pl
…
moremember.pl Bug 41749: Display patron consents on staff patron detail page 2026-02-06 15:17:28 -07:00
notices.pl Bug 41076: Adjust our perl tidiness for v20250105 2026-02-05 09:03:51 -07:00
patronimage.pl
…
pay.pl
…
paycollect.pl
…
print_overdues.pl
…
printfeercpt.pl
…
printinvoice.pl
…
printnotice.pl
…
printslip.pl Bug 35267: Migrate accounts_summary to printslip 2026-04-17 09:18:07 -06:00
purchase-suggestions.pl
…
readingrec.pl
…
recallshistory.pl
…
routing-lists.pl
…
setstatus.pl
…
statistics.pl Bug 42764: Fix spelling errors across the codebase 2026-06-11 09:53:34 -06:00
summary-print.pl
…
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
…