[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
Tue Jan 17 21:08:36 CET 2017


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

Josef Moravec <josef.moravec at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #57264|0                           |1
        is obsolete|                            |

--- Comment #2 from Josef Moravec <josef.moravec at gmail.com> ---
Created attachment 59098
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=59098&action=edit
[SIGNED-OFF] 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

Signed-off-by: Josef Moravec <josef.moravec at gmail.com>

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


More information about the Koha-bugs mailing list