Koha-clms/members
Petro Vashchuk fcb87024ad Bug 28759: limit accessibility for "Manage API keys"
This patch limits the accessibility for "Manage API keys" section only
to superlibrarians and the owner of that said API key account.

The way it does it is by checking if user is superlibrarian or if
logged-in user is the same as a patron id/borrower number is the same
as logged-in user number both in template and apikeys.pl and making sure
the link is inaccessible or redirects to the 403 page if user tries to
go there directly.

To reproduce:
1) create/pick existing patron, set Staff access, allows viewing
of catalogue in staff interface (catalogue)" and "Add, modify and
iew patron information (borrowers)" permissions on;
2) enable "RESTOAuth2ClientCredentials" in sysprefs;
3) login with that user into staff interface;
4) check any other patron, go to the "More"->"Manage API keys" and
check that you can see, add delete their API keys;
5) apply patch;
6) with that same user try to access "Manage API keys" page again.
Ensure that you can't access that page of other patrons but can
access your own page and manage your own API keys.
7) log in with superlibrarian now and ensure that you can access every
"Manage API keys" page of every patron and apply changes there.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-09-30 09:19:02 +02:00
..
accountline-details.pl Bug 22435: Update accountline-details page to show all history 2021-08-04 14:06:43 +02:00
apikeys.pl Bug 28759: limit accessibility for "Manage API keys" 2021-09-30 09:19:02 +02:00
boraccount.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
cancel-charge.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
default_messageprefs.pl Bug 18403: Update permissions - borrowers => 1|* becomes borrowers => 'edit_borrowers' 2018-02-12 15:41:37 -03:00
deletemem.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
discharge.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
discharges.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
files.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
guarantor_search.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
holdshistory.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
housebound.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
ill-requests.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
mancredit.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
maninvoice.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
member-flags.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
member-password.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
member.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
memberentry.pl Bug 28935: (QA follow-up) Use BorrowerUnwantedField on staff client 2021-09-30 09:18:57 +02:00
members-home.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
members-update-do.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
members-update.pl Bug 28073: Patron modifications should auto-open panel for referring patron record 2021-07-26 12:46:32 +02:00
merge-patrons.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
mod_debarment.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
moremember.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
notices.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
patronimage.pl Bug 28606: Remove $DEBUG and $ENV{DEBUG} 2021-06-24 11:53:44 +02:00
pay.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
paycollect.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
print_overdues.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
printfeercpt.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
printinvoice.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
printslip.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
purchase-suggestions.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
readingrec.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
routing-lists.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
setstatus.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
statistics.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
summary-print.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
update-child.pl Bug 28624: Remove Smart::Comments 2021-07-26 12:46:32 +02:00