[Bug 44325] New: Error 500 on patron details page when staff user can view patrons but has no circulation permission
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44325 Bug ID: 44325 Summary: Error 500 on patron details page when staff user can view patrons but has no circulation permission Initiative type: --- Sponsorship --- status: Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Patrons Assignee: koha-bugs@lists.koha-community.org Reporter: thibaud.guillot@biblibre.com QA Contact: testopia@bugs.koha-community.org CC: gmcharlt@gmail.com, kyle@bywatersolutions.com Target Milestone: --- Hello, A staff user who has 'catalogue' and 'borrowers > list_borrowers' can open members/moremember.pl, but svc/checkouts and svc/return_claims only allow users with 'circulate_remaining_permissions' or 'edit_borrowers'. When the permission check fails, both scripts call 'exit 0' without printing any HTTP header. The empty response is turned into a 500 Internal Server Error, and DataTables shows "Something went wrong when loading the table". -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44325 Thibaud Guillot (thibaud_g) <thibaud.guillot@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Comma delimited| |BibLibre list of Sponsors| | Assignee|koha-bugs@lists.koha-commun |thibaud.guillot@biblibre.co |ity.org |m Status|NEW |Needs Signoff Sponsorship status|--- |Sponsored Patch complexity|--- |Trivial patch -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44325 --- Comment #1 from Thibaud Guillot (thibaud_g) <thibaud.guillot@biblibre.com> --- Created attachment 212763 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=212763&action=edit Bug 44325: Do not load checkouts tables when the user lacks the required permissions This patch: - makes both services return a proper '403 Forbidden' response - does not display the checkouts table, the relatives' checkouts tab and the claims tab when the user is not allowed to fetch their content, and displays a message instead of the checkouts table Test plan: 1. Create a staff user with only 'catalogue' and 'borrowers > list_borrowers' 2. Set ClaimReturnedLostValue to any lost value 3. Log in with this user and go to the details page of a patron of the same library who has a checkout 4. Click "Show checkouts" => Error 500 (see the browser network tab for svc/checkouts) 5. Apply this patch, restart_all 6. Reload the page => A message says you do not have permission to view the details of the checkouts; the checkouts count is still displayed in the tab => The "Claims" and "Relatives' checkouts" tabs are not displayed 7. Go to a patron without checkouts => "Patron has nothing checked out." as before 8. Give the user 'circulate > circulate_remaining_permissions', reload => The checkouts table and the claims tab are displayed and load as before 9. Replace that permission with 'borrowers > edit_borrowers', reload => Same as 8. 10. As a superlibrarian, check circ/circulation.pl for the same patron => No change 11. Call /cgi-bin/koha/svc/checkouts?borrowernumber=X with the user of step 1 => 403 instead of 500 Sponsored-by: BibLibre -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org