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

Josef Moravec <josef.mora...@gmail.com> changed:

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

--- Comment #2 from Josef Moravec <josef.mora...@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.mora...@gmail.com>

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to