[Koha-bugs] [Bug 17565] REST API: Let user cancel reserve according to CanReserveBeCanceledFromOpac

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Mon Nov 7 15:50:06 CET 2016


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17565

--- Comment #1 from Lari Taskula <lari.taskula at jns.fi> ---
Created attachment 57264
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=57264&action=edit
Bug 17565: REST API: Let user cancel reserve according to
CanReserveBeCanceledFromOpac

This patch adds ability for patron to cancel their own holds.

To test:
1. Make sure you have patches from dependant bugs.
2. Apply this patch.
3. Place a hold for a patron that has no permissions.
4. Set hold to Waiting or Transfer status (found => 'W' or 'T' in database).
5. Login with that patron (and get their CGISESSID for cURL).
6. Test DELETE operation for the reserve_id that you just created, e.g.
   with cURL:

   curl -X DELETE -H "Content-Type: application/json" \
   --cookie 'CGISESSID=0230cb985c4fb5844f71ba41f76a0ced' \
   http://yourlib/api/v1/holds/4621
7. Observe HTTP 403 code and following error message:
   "Hold is already in transfer or waiting and cannot be cancelled by patron."
8. Reset hold's "found"-status in database.
9. Run the same cURL command as in step 6.
10. Observe HTTP 200 code and empty object as return.
11. Test DELETE operation for any other reserve_id, e.g. with cURL

   curl -X DELETE -H "Content-Type: application/json" \
   --cookie 'CGISESSID=0230cb985c4fb5844f71ba41f76a0ced' \
   http://yourlib/api/v1/holds/123
12. Observe permission required error.
13. Run t/db_dependent/api/v1/holds.t

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list