Bug 20794 - Don't show holds tab when user doesn't have circulate_remaining_permissions
Summary: Don't show holds tab when user doesn't have circulate_remaining_permissions
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Circulation (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Katrin Fischer
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-05-20 02:23 UTC by Katrin Fischer
Modified: 2019-10-14 19:56 UTC (History)
7 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 20794: Hide holds tab on details when user lacks circulate_remaining_permissions (2.49 KB, patch)
2018-05-20 02:27 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 20794: Hide holds tab on details when user lacks circulate_remaining_permissions (2.55 KB, patch)
2018-06-11 09:21 UTC, Amit Gupta
Details | Diff | Splinter Review
Bug 20794: Hide holds tab on details when user lacks circulate_remaining_permissions (2.62 KB, patch)
2018-06-19 13:48 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Katrin Fischer 2018-05-20 02:23:17 UTC
If a user doesn't have circulate_remaining permissions, but has borrowers:
- checkouts tab is hidden
- details tab is visible
- holds tab on details is visible, but results in an error

The problem is that the svc/holds script requires circulate_remaining_permissions.
Comment 1 Katrin Fischer 2018-05-20 02:27:19 UTC
Created attachment 75447 [details] [review]
Bug 20794: Hide holds tab on details when user lacks circulate_remaining_permissions

If a user doesn't have circulate_remaining permissions, but has borrowers:
- checkouts tab is hidden
- details tab is visible
- holds tab on details is visible, but results in an error

The problem is that the svc/holds script requires circulate_remaining_permissions.

To test:
- Create 2 staff users with and without circulate_remaining_permissions
  Both need borrowers permission
- Go to the details tab in a patron's account who has holds
- Verify that you get a datatables error for the staff patron without
  circulate_remaining_permissions
- Apply patch
- Verify that now the holds tab is no longer displayed for this patron
Comment 2 Amit Gupta 2018-06-11 09:21:17 UTC
Created attachment 75944 [details] [review]
Bug 20794: Hide holds tab on details when user lacks  circulate_remaining_permissions

Work OK

---------------
Test
If a user doesn't have circulate_remaining permissions, but has borrowers:
- checkouts tab is hidden
- details tab is visible
- holds tab on details is visible, but results in an error

The problem is that the svc/holds script requires circulate_remaining_permissions.

To test:
- Create 2 staff users with and without circulate_remaining_permissions
  Both need borrowers permission
- Go to the details tab in a patron's account who has holds
- Verify that you get a datatables error for the staff patron without
  circulate_remaining_permissions
- Apply patch
- Verify that now the holds tab is no longer displayed for this patron
Comment 3 Jonathan Druart 2018-06-19 13:47:29 UTC
I have no idea if the permissions are ok but this patch makes sense as a quick fix at least.
Comment 4 Jonathan Druart 2018-06-19 13:48:20 UTC
Created attachment 76174 [details] [review]
Bug 20794: Hide holds tab on details when user lacks circulate_remaining_permissions

If a user doesn't have circulate_remaining permissions, but has borrowers:
- checkouts tab is hidden
- details tab is visible
- holds tab on details is visible, but results in an error

The problem is that the svc/holds script requires circulate_remaining_permissions.

To test:
- Create 2 staff users with and without circulate_remaining_permissions
  Both need borrowers permission
- Go to the details tab in a patron's account who has holds
- Verify that you get a datatables error for the staff patron without
  circulate_remaining_permissions
- Apply patch
- Verify that now the holds tab is no longer displayed for this patron

Signed-off-by: Amit Gupta <amit.gupta@informaticsglobal.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 5 Nick Clemens 2018-06-22 13:50:43 UTC
Awesome work all!

Pushed to master for 18.11.x
Comment 6 Martin Renvoize 2018-06-25 17:36:08 UTC
Pushed to 18.05.x for 18.05.02
Comment 7 Fridolin Somers 2018-06-28 07:30:53 UTC
Pushed to 17.11.x for 17.11.08