In the intranet, when the system preference IndependentBranches is enabled, non-superlibrarians can make reservations in other libraries, which they shouldn't be able to do.
Created attachment 159346 [details] [review] Bug 35434: IndependentBranches prevents non-superlibrarians from placing holds in other libraries I updated the hold page on the staff interface so that non-superlibrarians can't place holds in other libraries when the system preference 'IndependentBranches' is enabled. TEST PLAN 1) Appy the patch. 2) In 'Koha administration > System preferences', set 'IndependentBranches' to 'yes'. 3) In 'Koha administration > Circulation and fines rules', add a rule by only clicking the 'Save' button (this will create a circulation rule for all patron categories and all item types, allowing unlimited holds). 4) Create a staff patron (with username and password). ---> In 'Patrons > + New patron > Staff', fill the required fields, add a username and password. ---> Remember the home library. ---> Click the 'Save' button. 5) Add permissions to the created patron. ---> In the patron detail page, click on 'More > Set permissions' and check the following boxes: - Staff access, allows viewing of catalogue in staff interface - Add, modify and view patron information - Place and modify holds for patrons ---> Click the 'Save' button. 6) Create an other patron of any patron category with the same home library as the staff patron you created. 7) Create a record with one item. ---> In 'Cataloging > + New record', fill the required fields. ---> Click the 'Save' button. ---> You should now be in the item form. Fill the required field (home library and current library should be the same as the patron's home library). ---> Click the 'Add item' button. 8) On the record details page, click 'Place hold' and search for the patron you created in step 6. ---> In the 'Pickup at' field, you should see all the libraries. ---> In the 'Allowed pickup locations' column of the item, you should see the same. 9) Log out from the staff interface and login with the staff patron you created. 10) Click 'Search catalog' from the search bar and search for the record you created. 11) On the record details page, click 'Place hold', then search for the patron in step 6. ---> In the 'Pickup at' field, you should only see the home library of the item. ---> In the 'Allowed pickup locations' column of the item, you should see the same.
Emily, can we have a unit test for this?
IIRC canreservefromotherbranches was also used in this context, but it seems missing from the test plan.
Created attachment 161509 [details] [review] Bug 35434: IndependentBranches prevents non-superlibrarians from placing holds in other libraries I updated the hold page on the staff interface so that non-superlibrarians can't place holds in other libraries when the system preference 'IndependentBranches' is enabled. TEST PLAN 1) Appy the patch. 2) In 'Koha administration > System preferences', set 'IndependentBranches' to 'yes'. 3) In 'Koha administration > Circulation and fines rules', add a rule by only clicking the 'Save' button (this will create a circulation rule for all patron categories and all item types, allowing unlimited holds). 4) Create a staff patron (with username and password). ---> In 'Patrons > + New patron > Staff', fill the required fields, add a username and password. ---> Remember the home library. ---> Click the 'Save' button. 5) Add permissions to the created patron. ---> In the patron detail page, click on 'More > Set permissions' and check the following boxes: - Staff access, allows viewing of catalogue in staff interface - Add, modify and view patron information - Place and modify holds for patrons ---> Click the 'Save' button. 6) Create an other patron of any patron category with the same home library as the staff patron you created. 7) Create a record with one item. ---> In 'Cataloging > + New record', fill the required fields. ---> Click the 'Save' button. ---> You should now be in the item form. Fill the required field (home library and current library should be the same as the patron's home library). ---> Click the 'Add item' button. 8) On the record details page, click 'Place hold' and search for the patron you created in step 6. ---> In the 'Pickup at' field, you should see all the libraries. ---> In the 'Allowed pickup locations' column of the item, you should see the same. 9) Log out from the staff interface and login with the staff patron you created. 10) Click 'Search catalog' from the search bar and search for the record you created. 11) On the record details page, click 'Place hold', then search for the patron in step 6. ---> In the 'Pickup at' field, you should only see the home library of the item. ---> In the 'Allowed pickup locations' column of the item, you should see the same. Signed-off-by: Anni Rajala <anni.rajala@turku.fi>
(In reply to Katrin Fischer from comment #3) > IIRC canreservefromotherbranches was also used in this context, but it seems > missing from the test plan. Can you please reply/comment?
Emily Rose is back at school. I'll assign this issue to another dev, they should be able to answer you shortly.
Thanks!
Here comes the updated version of plan test : TEST PLAN 1) Appy the patch. 2) In 'Koha administration > System preferences' : - set 'IndependentBranches' to 'yes' - set 'IndependentBranchesPatronModifications' to 'yes' - set 'IndependentBranchesTransfers' to 'yes' - set 'canreservefromotherbranches' to 'Don't allow' 3) In 'Koha administration > Circulation and fines rules', add a rule by only clicking the 'Save' button (this will create a circulation rule for all patron categories and all item types, allowing unlimited holds). 4) Create a staff patron (with username and password). ---> In 'Patrons > + New patron > Staff', fill the required fields, add a username and password. ---> Remember the home library. ---> Click the 'Save' button. 5) Add permissions to the created patron. ---> In the patron detail page, click on 'More > Set permissions' and check the following boxes: - Staff access, allows viewing of catalogue in staff interface - Add, modify and view patron information - Place and modify holds for patrons ---> Click the 'Save' button. 6) Create an other patron of any patron category with the same home library as the staff patron you created. 7) Create a record with one item. ---> In 'Cataloging > + New record', fill the required fields. ---> Click the 'Save' button. ---> You should now be in the item form. Fill the required field (home library and current library should be the same as the patron's home library). ---> Click the 'Add item' button. 8) On the record details page, click 'Place hold' and search for the patron you created in step 6. ---> In the 'Pickup at' field, you should see all the libraries. ---> In the 'Allowed pickup locations' column of the item, you should see the same. 9) Log out from the staff interface and login with the staff patron you created. 10) Click 'Search catalog' from the search bar and search for the record you created. 11) On the record details page, click 'Place hold', then search for the patron in step 6. ---> In the 'Pickup at' field, you should only see the home library of the item. ---> In the 'Allowed pickup locations' column of the item, you should see the same.
Created attachment 166648 [details] [review] Bug 35434: IndependentBranches prevents non-superlibrarians from placing holds in other libraries I updated the hold page on the staff interface so that non-superlibrarians can't place holds in other libraries when the system preference 'IndependentBranches' is enabled. TEST PLAN 1) Appy the patch. 2) In 'Koha administration > System preferences', set 'IndependentBranches' to 'yes'. 3) In 'Koha administration > Circulation and fines rules', add a rule by only clicking the 'Save' button (this will create a circulation rule for all patron categories and all item types, allowing unlimited holds). 4) Create a staff patron (with username and password). ---> In 'Patrons > + New patron > Staff', fill the required fields, add a username and password. ---> Remember the home library. ---> Click the 'Save' button. 5) Add permissions to the created patron. ---> In the patron detail page, click on 'More > Set permissions' and check the following boxes: - Staff access, allows viewing of catalogue in staff interface - Add, modify and view patron information - Place and modify holds for patrons ---> Click the 'Save' button. 6) Create an other patron of any patron category with the same home library as the staff patron you created. 7) Create a record with one item. ---> In 'Cataloging > + New record', fill the required fields. ---> Click the 'Save' button. ---> You should now be in the item form. Fill the required field (home library and current library should be the same as the patron's home library). ---> Click the 'Add item' button. 8) On the record details page, click 'Place hold' and search for the patron you created in step 6. ---> In the 'Pickup at' field, you should see all the libraries. ---> In the 'Allowed pickup locations' column of the item, you should see the same. 9) Log out from the staff interface and login with the staff patron you created. 10) Click 'Search catalog' from the search bar and search for the record you created. 11) On the record details page, click 'Place hold', then search for the patron in step 6. ---> In the 'Pickup at' field, you should only see the home library of the item. ---> In the 'Allowed pickup locations' column of the item, you should see the same. Signed-off-by: Anni Rajala <anni.rajala@turku.fi> Signed-off-by: baptiste <baptiste.bayche@inlibro.com>
Can we get a unit test for this change?
Created attachment 169917 [details] [review] Bug 35434: IndependentBranches prevents non-superlibrarians from placing holds in other libraries I updated the hold page on the staff interface so that non-superlibrarians can't place holds in other libraries when the system preference 'IndependentBranches' is enabled. TEST PLAN 1) Appy the patch. 2) In 'Koha administration > System preferences', set 'IndependentBranches' to 'yes'. 3) In 'Koha administration > Circulation and fines rules', add a rule by only clicking the 'Save' button (this will create a circulation rule for all patron categories and all item types, allowing unlimited holds). 4) Create a staff patron (with username and password). ---> In 'Patrons > + New patron > Staff', fill the required fields, add a username and password. ---> Remember the home library. ---> Click the 'Save' button. 5) Add permissions to the created patron. ---> In the patron detail page, click on 'More > Set permissions' and check the following boxes: - Staff access, allows viewing of catalogue in staff interface - Add, modify and view patron information - Place and modify holds for patrons ---> Click the 'Save' button. 6) Create an other patron of any patron category with the same home library as the staff patron you created. 7) Create a record with one item. ---> In 'Cataloging > + New record', fill the required fields. ---> Click the 'Save' button. ---> You should now be in the item form. Fill the required field (home library and current library should be the same as the patron's home library). ---> Click the 'Add item' button. 8) On the record details page, click 'Place hold' and search for the patron you created in step 6. ---> In the 'Pickup at' field, you should see all the libraries. ---> In the 'Allowed pickup locations' column of the item, you should see the same. 9) Log out from the staff interface and login with the staff patron you created. 10) Click 'Search catalog' from the search bar and search for the record you created. 11) On the record details page, click 'Place hold', then search for the patron in step 6. ---> In the 'Pickup at' field, you should only see the home library of the item. ---> In the 'Allowed pickup locations' column of the item, you should see the same. Signed-off-by: Anni Rajala <anni.rajala@turku.fi> Signed-off-by: baptiste <baptiste.bayche@inlibro.com>
Created attachment 169918 [details] [review] Bug 35434: (follow-up) added canreservefromotherbranches in addition to canreservefromotherbranches to prevent non-superlibrarians from placing holds in other libraries
Created attachment 169919 [details] [review] Bug 35434: (follow-up) Unit test
Step 11 of the plan test fails : 11) On the record details page, click 'Place hold', then search for the patron in step 6. ---> In the 'Pickup at' field, you should only see the home library of the item. ---> In the 'Allowed pickup locations' column of the item, you should see the same. KO : For the librarians having limited permissions, all libraries are still in the pickup location dropdown menu.
After looking at the code, it seems the testing plans was missing some info. When you go and set IndependentBranches to true, you also need to set canreservefromotherbranches to don't allow. It worked for me when i added this setting
TEST PLAN 1) Appy the patch. 2) In 'Koha administration > System preferences', set 'IndependentBranches' to 'yes' And 'canreservefromotherbranches' to 'Don't allow'. 3) In 'Koha administration > Circulation and fines rules', add a rule by only clicking the 'Save' button (this will create a circulation rule for all patron categories and all item types, allowing unlimited holds). 4) Create a staff patron (with username and password). ---> In 'Patrons > + New patron > Staff', fill the required fields, add a username and password. ---> Remember the home library. ---> Click the 'Save' button. 5) Add permissions to the created patron. ---> In the patron detail page, click on 'More > Set permissions' and check the following boxes: - Staff access, allows viewing of catalogue in staff interface - Add, modify and view patron information - Place and modify holds for patrons ---> Click the 'Save' button. 6) Create an other patron of any patron category with the same home library as the staff patron you created. 7) Create a record with one item. ---> In 'Cataloging > + New record', fill the required fields. ---> Click the 'Save' button. ---> You should now be in the item form. Fill the required field (home library and current library should be the same as the patron's home library). ---> Click the 'Add item' button. 8) On the record details page, click 'Place hold' and search for the patron you created in step 6. ---> In the 'Pickup at' field, you should see all the libraries. ---> In the 'Allowed pickup locations' column of the item, you should see the same. 9) Log out from the staff interface and login with the staff patron you created. 10) Click 'Search catalog' from the search bar and search for the record you created. 11) On the record details page, click 'Place hold', then search for the patron in step 6. ---> In the 'Pickup at' field, you should only see the home library of the item. ---> In the 'Allowed pickup locations' column of the item, you should see the same.
Feel free to change it back to failed qa if there anything else missing