Bug 20256 - Add ability to limit editing of items to home library
Summary: Add ability to limit editing of items to home library
Status: Signed Off
Alias: None
Product: Koha
Classification: Unclassified
Component: Cataloging (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Kyle M Hall
QA Contact: Testopia
URL:
Keywords:
: 22923 (view as bug list)
Depends on:
Blocks:
 
Reported: 2018-02-21 08:00 UTC by Kyle M Hall
Modified: 2021-01-29 15:34 UTC (History)
10 users (show)

See Also:
Change sponsored?: Sponsored
Patch complexity: ---
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 20256: Update database (3.40 KB, patch)
2019-03-29 18:58 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: Add new permission to editor (1.32 KB, patch)
2019-03-29 18:58 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: Refactor subs for rights to view patrons to make them generic for general use (3.63 KB, patch)
2019-03-29 18:58 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: Add new methods for checking item editing permissions (4.32 KB, patch)
2019-03-29 18:59 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: Update Schema file (1.61 KB, patch)
2019-03-29 18:59 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: Update groups editor (8.65 KB, patch)
2019-03-29 18:59 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: Use new methods (7.18 KB, patch)
2019-03-29 18:59 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: Add unit tests (5.26 KB, patch)
2019-03-29 18:59 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: Update database (3.83 KB, patch)
2019-04-01 10:17 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: Update database (3.83 KB, patch)
2019-04-01 10:52 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: Add new permission to editor (1.32 KB, patch)
2019-04-01 10:52 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: Refactor subs for rights to view patrons to make them generic for general use (3.63 KB, patch)
2019-04-01 10:52 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: Add new methods for checking item editing permissions (4.31 KB, patch)
2019-04-01 10:52 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: Update Schema file (1.61 KB, patch)
2019-04-01 10:52 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: Update groups editor (8.65 KB, patch)
2019-04-01 10:52 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: Use new methods (7.18 KB, patch)
2019-04-01 10:52 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: Add unit tests (5.26 KB, patch)
2019-04-01 10:52 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: Update database (3.95 KB, patch)
2019-04-23 16:39 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: Update database (3.95 KB, patch)
2019-04-23 16:40 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: Add new permission to editor (1.43 KB, patch)
2019-04-23 16:40 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: Refactor subs for rights to view patrons to make them generic for general use (3.74 KB, patch)
2019-04-23 16:40 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: Add new methods for checking item editing permissions (4.42 KB, patch)
2019-04-23 16:40 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: Update Schema file (1.72 KB, patch)
2019-04-23 16:41 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: Update groups editor (8.76 KB, patch)
2019-04-23 16:41 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: Use new methods (7.29 KB, patch)
2019-04-23 16:41 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: Add unit tests (5.43 KB, patch)
2019-04-23 16:41 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: (QA Follow-up) Remove double negative from code (2.74 KB, patch)
2019-04-24 15:05 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: (QA follow-up) Remove double negative from code (2.72 KB, patch)
2019-04-25 07:48 UTC, Josef Moravec
Details | Diff | Splinter Review
Bug 20256: (QA follow-up) Change meaning should change code (889 bytes, patch)
2019-04-25 07:48 UTC, Josef Moravec
Details | Diff | Splinter Review
Bug 20256: (QA follow-up) test borrowernumber in userenv too (1.15 KB, patch)
2019-04-25 07:48 UTC, Josef Moravec
Details | Diff | Splinter Review
Bug 20256: (QA follow-up) Fix column description for ft_limit_item_editing (1.41 KB, patch)
2019-04-25 07:48 UTC, Josef Moravec
Details | Diff | Splinter Review
Bug 20256: (QA follow-up) Fix missed change from item.cannot_be_edited to item.can_be_edited (1.26 KB, patch)
2019-04-26 14:59 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: (QA follow-up) Redirect to record details page if user cannot edit this item (2.48 KB, patch)
2019-04-26 14:59 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: Update database (3.83 KB, patch)
2019-12-05 12:05 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: Update database (3.83 KB, patch)
2019-12-05 12:06 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: Add new permission to editor (1.32 KB, patch)
2019-12-05 12:06 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: Refactor subs for rights to view patrons to make them generic for general use (3.63 KB, patch)
2019-12-05 12:06 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: Add new methods for checking item editing permissions (4.31 KB, patch)
2019-12-05 12:06 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: Update Schema file (1.57 KB, patch)
2019-12-05 12:06 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: Update groups editor (8.65 KB, patch)
2019-12-05 12:06 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: Use new methods (6.90 KB, patch)
2019-12-05 12:06 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: Add unit tests (5.32 KB, patch)
2019-12-05 12:06 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: (QA follow-up) Remove double negative from code (2.74 KB, patch)
2019-12-05 12:06 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: (QA follow-up) Change meaning should change code (907 bytes, patch)
2019-12-05 12:07 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: (QA follow-up) test borrowernumber in userenv too (1.16 KB, patch)
2019-12-05 12:07 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: (QA follow-up) Fix column description for ft_limit_item_editing (1.42 KB, patch)
2019-12-05 12:07 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: (QA follow-up) Fix missed change from item.cannot_be_edited to item.can_be_edited (1.24 KB, patch)
2019-12-05 12:07 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: (QA follow-up) Redirect to record details page if user cannot edit this item (2.48 KB, patch)
2019-12-05 12:07 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: (QA follow-up) Handle non-existing userenv (742 bytes, patch)
2019-12-05 12:07 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: (QA follow-up) Give existing users with edit_items permission edit_any_item as well (1.36 KB, patch)
2019-12-05 12:07 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: (QA follow-up) Skip batch editing items the user is not allowed to edit (1.15 KB, patch)
2019-12-05 12:07 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: (QA follow-up) Filter out branchcodes the user has no permissions for (3.31 KB, patch)
2019-12-05 12:07 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: Update database (3.58 KB, patch)
2020-04-09 14:42 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: Update database (3.58 KB, patch)
2020-04-09 14:44 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: Update database (3.58 KB, patch)
2020-04-09 14:45 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: Add new permission to editor (1.32 KB, patch)
2020-04-09 14:45 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: Refactor subs for rights to view patrons to make them generic for general use (3.63 KB, patch)
2020-04-09 14:45 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: Add new methods for checking item editing permissions (4.31 KB, patch)
2020-04-09 14:45 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: Update groups editor (9.32 KB, patch)
2020-04-09 14:45 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: Use new methods (6.92 KB, patch)
2020-04-09 14:45 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: Add unit tests (5.38 KB, patch)
2020-04-09 14:45 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: (QA follow-up) Remove double negative from code (2.76 KB, patch)
2020-04-09 14:45 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: (QA follow-up) Change meaning should change code (931 bytes, patch)
2020-04-09 14:45 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: (QA follow-up) test borrowernumber in userenv too (1.21 KB, patch)
2020-04-09 14:45 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: (QA follow-up) Fix column description for ft_limit_item_editing (1.47 KB, patch)
2020-04-09 14:45 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: (QA follow-up) Fix missed change from item.cannot_be_edited to item.can_be_edited (1.31 KB, patch)
2020-04-09 14:46 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: (QA follow-up) Redirect to record details page if user cannot edit this item (2.48 KB, patch)
2020-04-09 14:46 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: (QA follow-up) Handle non-existing userenv (740 bytes, patch)
2020-04-09 14:46 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: (QA follow-up) Give existing users with edit_items permission edit_any_item as well (1.36 KB, patch)
2020-04-09 14:46 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: (QA follow-up) Skip batch editing items the user is not allowed to edit (1.09 KB, patch)
2020-04-09 14:46 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: (QA follow-up) Filter out branchcodes the user has no permissions for (4.05 KB, patch)
2020-04-09 14:46 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: Mark ft_limit_item_editing as boolean in schema file (1.06 KB, patch)
2020-04-09 14:46 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: Update DB Schema [DO NOT PUSH] (1.58 KB, patch)
2020-04-09 14:46 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: Update database (3.58 KB, patch)
2020-04-10 13:08 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: Update database (3.58 KB, patch)
2020-04-10 13:08 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: Add new permission to editor (1.32 KB, patch)
2020-04-10 13:08 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: Refactor subs for rights to view patrons to make them generic for general use (3.63 KB, patch)
2020-04-10 13:08 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: Add new methods for checking item editing permissions (4.31 KB, patch)
2020-04-10 13:09 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: Update groups editor (9.32 KB, patch)
2020-04-10 13:09 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: Use new methods (6.92 KB, patch)
2020-04-10 13:09 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: Add unit tests (5.38 KB, patch)
2020-04-10 13:09 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: (QA follow-up) Remove double negative from code (2.76 KB, patch)
2020-04-10 13:09 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: (QA follow-up) Change meaning should change code (931 bytes, patch)
2020-04-10 13:09 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: (QA follow-up) test borrowernumber in userenv too (1.21 KB, patch)
2020-04-10 13:09 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: (QA follow-up) Fix column description for ft_limit_item_editing (1.47 KB, patch)
2020-04-10 13:09 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: (QA follow-up) Fix missed change from item.cannot_be_edited to item.can_be_edited (1.31 KB, patch)
2020-04-10 13:09 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: (QA follow-up) Redirect to record details page if user cannot edit this item (2.48 KB, patch)
2020-04-10 13:09 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: (QA follow-up) Handle non-existing userenv (740 bytes, patch)
2020-04-10 13:09 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: (QA follow-up) Give existing users with edit_items permission edit_any_item as well (1.36 KB, patch)
2020-04-10 13:09 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: (QA follow-up) Skip batch editing items the user is not allowed to edit (1.09 KB, patch)
2020-04-10 13:09 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: (QA follow-up) Filter out branchcodes the user has no permissions for (4.05 KB, patch)
2020-04-10 13:09 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: Mark ft_limit_item_editing as boolean in schema file (1.06 KB, patch)
2020-04-10 13:09 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: Update DB Schema [DO NOT PUSH] (1.58 KB, patch)
2020-04-10 13:10 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: Update database (3.64 KB, patch)
2020-04-10 16:31 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: Update database (3.64 KB, patch)
2020-04-10 16:31 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: Add new permission to editor (1.37 KB, patch)
2020-04-10 16:31 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: Refactor subs for rights to view patrons to make them generic for general use (3.69 KB, patch)
2020-04-10 16:32 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: Add new methods for checking item editing permissions (4.37 KB, patch)
2020-04-10 16:32 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: Update groups editor (9.37 KB, patch)
2020-04-10 16:32 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: Use new methods (6.98 KB, patch)
2020-04-10 16:32 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: Add unit tests (5.44 KB, patch)
2020-04-10 16:32 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: (QA follow-up) Remove double negative from code (2.82 KB, patch)
2020-04-10 16:32 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: (QA follow-up) Change meaning should change code (990 bytes, patch)
2020-04-10 16:32 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: (QA follow-up) test borrowernumber in userenv too (1.27 KB, patch)
2020-04-10 16:32 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: (QA follow-up) Fix column description for ft_limit_item_editing (1.53 KB, patch)
2020-04-10 16:32 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: (QA follow-up) Fix missed change from item.cannot_be_edited to item.can_be_edited (1.36 KB, patch)
2020-04-10 16:32 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: (QA follow-up) Redirect to record details page if user cannot edit this item (2.54 KB, patch)
2020-04-10 16:32 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: (QA follow-up) Handle non-existing userenv (799 bytes, patch)
2020-04-10 16:32 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: (QA follow-up) Give existing users with edit_items permission edit_any_item as well (1.42 KB, patch)
2020-04-10 16:32 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: (QA follow-up) Skip batch editing items the user is not allowed to edit (1.15 KB, patch)
2020-04-10 16:32 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: (QA follow-up) Filter out branchcodes the user has no permissions for (4.11 KB, patch)
2020-04-10 16:33 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: Mark ft_limit_item_editing as boolean in schema file (1.12 KB, patch)
2020-04-10 16:33 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: Update DB Schema [DO NOT PUSH] (1.63 KB, patch)
2020-04-10 16:33 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: Update database (3.64 KB, patch)
2020-07-24 11:34 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: Add new permission to editor (1.37 KB, patch)
2020-07-24 11:35 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: Refactor subs for rights to view patrons to make them generic for general use (3.69 KB, patch)
2020-07-24 11:35 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: Add new methods for checking item editing permissions (4.37 KB, patch)
2020-07-24 11:35 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: Update groups editor (9.37 KB, patch)
2020-07-24 11:35 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: Use new methods (6.98 KB, patch)
2020-07-24 11:35 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: Add unit tests (5.28 KB, patch)
2020-07-24 11:35 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: (QA follow-up) Remove double negative from code (2.82 KB, patch)
2020-07-24 11:35 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: (QA follow-up) Change meaning should change code (990 bytes, patch)
2020-07-24 11:35 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: (QA follow-up) test borrowernumber in userenv too (1.27 KB, patch)
2020-07-24 11:35 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: (QA follow-up) Fix column description for ft_limit_item_editing (1.53 KB, patch)
2020-07-24 11:35 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: (QA follow-up) Fix missed change from item.cannot_be_edited to item.can_be_edited (1.36 KB, patch)
2020-07-24 11:35 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: (QA follow-up) Redirect to record details page if user cannot edit this item (2.54 KB, patch)
2020-07-24 11:35 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: (QA follow-up) Handle non-existing userenv (799 bytes, patch)
2020-07-24 11:35 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: (QA follow-up) Give existing users with edit_items permission edit_any_item as well (1.42 KB, patch)
2020-07-24 11:36 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: (QA follow-up) Skip batch editing items the user is not allowed to edit (1.38 KB, patch)
2020-07-24 11:36 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: (QA follow-up) Filter out branchcodes the user has no permissions for (4.12 KB, patch)
2020-07-24 11:36 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: Mark ft_limit_item_editing as boolean in schema file (1.12 KB, patch)
2020-07-24 11:36 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: Update DB Schema [DO NOT PUSH] (1.63 KB, patch)
2020-07-24 11:36 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: Update database (3.64 KB, patch)
2020-08-21 18:17 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: Update database (3.64 KB, patch)
2020-08-21 18:19 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: Add new permission to editor (1.37 KB, patch)
2020-08-21 18:19 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: Refactor subs for rights to view patrons to make them generic for general use (3.69 KB, patch)
2020-08-21 18:19 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: Add new methods for checking item editing permissions (4.37 KB, patch)
2020-08-21 18:19 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: Update groups editor (9.37 KB, patch)
2020-08-21 18:20 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: Use new methods (7.03 KB, patch)
2020-08-21 18:20 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: Add unit tests (5.28 KB, patch)
2020-08-21 18:20 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: (QA follow-up) Remove double negative from code (2.82 KB, patch)
2020-08-21 18:20 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: (QA follow-up) Change meaning should change code (990 bytes, patch)
2020-08-21 18:20 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: (QA follow-up) test borrowernumber in userenv too (1.27 KB, patch)
2020-08-21 18:20 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: (QA follow-up) Fix column description for ft_limit_item_editing (1.53 KB, patch)
2020-08-21 18:20 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: (QA follow-up) Fix missed change from item.cannot_be_edited to item.can_be_edited (1.36 KB, patch)
2020-08-21 18:20 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: (QA follow-up) Redirect to record details page if user cannot edit this item (2.18 KB, patch)
2020-08-21 18:20 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: (QA follow-up) Handle non-existing userenv (799 bytes, patch)
2020-08-21 18:20 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: (QA follow-up) Give existing users with edit_items permission edit_any_item as well (1.42 KB, patch)
2020-08-21 18:20 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: (QA follow-up) Skip batch editing items the user is not allowed to edit (1.38 KB, patch)
2020-08-21 18:20 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: (QA follow-up) Filter out branchcodes the user has no permissions for (4.14 KB, patch)
2020-08-21 18:20 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: Mark ft_limit_item_editing as boolean in schema file (1.12 KB, patch)
2020-08-21 18:21 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: Update DB Schema [DO NOT PUSH] (1.63 KB, patch)
2020-08-21 18:21 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: (QA follow-up) Fix variable masking warning in additem.pl (775 bytes, patch)
2020-09-11 13:12 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: (QA follow-up) Fix number of tests in Patrons.t (678 bytes, patch)
2020-09-12 22:43 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 20256: Update database (3.68 KB, patch)
2020-11-17 12:27 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: Add new permission to editor (1.37 KB, patch)
2020-11-17 12:27 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: Refactor subs for rights to view patrons to make them generic for general use (3.69 KB, patch)
2020-11-17 12:27 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: Add new methods for checking item editing permissions (4.37 KB, patch)
2020-11-17 12:28 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: Update groups editor (9.37 KB, patch)
2020-11-17 12:28 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: Use new methods (7.12 KB, patch)
2020-11-17 12:28 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: Add unit tests (5.28 KB, patch)
2020-11-17 12:28 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: (QA follow-up) Remove double negative from code (2.80 KB, patch)
2020-11-17 12:28 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: (QA follow-up) Change meaning should change code (969 bytes, patch)
2020-11-17 12:28 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: (QA follow-up) test borrowernumber in userenv too (1.27 KB, patch)
2020-11-17 12:28 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: (QA follow-up) Fix column description for ft_limit_item_editing (1.53 KB, patch)
2020-11-17 12:28 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: (QA follow-up) Fix missed change from item.cannot_be_edited to item.can_be_edited (1.58 KB, patch)
2020-11-17 12:28 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: (QA follow-up) Redirect to record details page if user cannot edit this item (2.18 KB, patch)
2020-11-17 12:28 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: (QA follow-up) Handle non-existing userenv (799 bytes, patch)
2020-11-17 12:29 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: (QA follow-up) Give existing users with edit_items permission edit_any_item as well (1.42 KB, patch)
2020-11-17 12:29 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: (QA follow-up) Skip batch editing items the user is not allowed to edit (1.36 KB, patch)
2020-11-17 12:29 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: (QA follow-up) Filter out branchcodes the user has no permissions for (4.14 KB, patch)
2020-11-17 12:29 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: Mark ft_limit_item_editing as boolean in schema file (1.12 KB, patch)
2020-11-17 12:29 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: Update DB Schema [DO NOT PUSH] (1.63 KB, patch)
2020-11-17 12:29 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: (QA follow-up) Fix variable masking warning in additem.pl (775 bytes, patch)
2020-11-17 12:29 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: (QA follow-up) Fix number of tests in Patrons.t (694 bytes, patch)
2020-11-17 12:29 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: (QA follow-up) Implement for course reserves (3.47 KB, patch)
2020-11-17 12:30 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: (QA follow-up) Implement for item search (3.50 KB, patch)
2020-11-17 12:30 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: Update database (3.78 KB, patch)
2021-01-29 15:31 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: Update database (3.78 KB, patch)
2021-01-29 15:32 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: Add new permission to editor (1.37 KB, patch)
2021-01-29 15:32 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: Refactor subs for rights to view patrons to make them generic for general use (3.69 KB, patch)
2021-01-29 15:33 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: Add new methods for checking item editing permissions (4.37 KB, patch)
2021-01-29 15:33 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: Update groups editor (9.37 KB, patch)
2021-01-29 15:33 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: Use new methods (7.12 KB, patch)
2021-01-29 15:33 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: Add unit tests (5.28 KB, patch)
2021-01-29 15:33 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: (QA follow-up) Remove double negative from code (2.80 KB, patch)
2021-01-29 15:33 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: (QA follow-up) Change meaning should change code (969 bytes, patch)
2021-01-29 15:33 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: (QA follow-up) test borrowernumber in userenv too (1.27 KB, patch)
2021-01-29 15:33 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: (QA follow-up) Fix missed change from item.cannot_be_edited to item.can_be_edited (1.58 KB, patch)
2021-01-29 15:33 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: (QA follow-up) Redirect to record details page if user cannot edit this item (2.18 KB, patch)
2021-01-29 15:33 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: (QA follow-up) Handle non-existing userenv (799 bytes, patch)
2021-01-29 15:33 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: (QA follow-up) Give existing users with edit_items permission edit_any_item as well (1.42 KB, patch)
2021-01-29 15:33 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: (QA follow-up) Skip batch editing items the user is not allowed to edit (1.36 KB, patch)
2021-01-29 15:33 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: (QA follow-up) Filter out branchcodes the user has no permissions for (4.14 KB, patch)
2021-01-29 15:34 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: Mark ft_limit_item_editing as boolean in schema file (1.12 KB, patch)
2021-01-29 15:34 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: (QA follow-up) Fix variable masking warning in additem.pl (775 bytes, patch)
2021-01-29 15:34 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: (QA follow-up) Fix number of tests in Patrons.t (694 bytes, patch)
2021-01-29 15:34 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: (QA follow-up) Implement for course reserves (3.47 KB, patch)
2021-01-29 15:34 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: (QA follow-up) Implement for item search (3.50 KB, patch)
2021-01-29 15:34 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20256: Update DB Schema [DO NOT PUSH] (1.67 KB, patch)
2021-01-29 15:34 UTC, Kyle M Hall
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Kyle M Hall 2018-02-21 08:00:10 UTC
A.) Base work off of bug 18403
B.) Add limit for items in similar manner that 18403 does for patrons
Comment 1 Kyle M Hall 2019-03-29 18:58:44 UTC Comment hidden (obsolete)
Comment 2 Kyle M Hall 2019-03-29 18:58:54 UTC Comment hidden (obsolete)
Comment 3 Kyle M Hall 2019-03-29 18:58:57 UTC Comment hidden (obsolete)
Comment 4 Kyle M Hall 2019-03-29 18:59:00 UTC Comment hidden (obsolete)
Comment 5 Kyle M Hall 2019-03-29 18:59:03 UTC Comment hidden (obsolete)
Comment 6 Kyle M Hall 2019-03-29 18:59:06 UTC Comment hidden (obsolete)
Comment 7 Kyle M Hall 2019-03-29 18:59:10 UTC Comment hidden (obsolete)
Comment 8 Kyle M Hall 2019-03-29 18:59:13 UTC Comment hidden (obsolete)
Comment 9 Kyle M Hall 2019-03-29 19:38:48 UTC
Needs a test plan...
Comment 10 Kyle M Hall 2019-04-01 10:17:47 UTC Comment hidden (obsolete)
Comment 11 Kyle M Hall 2019-04-01 10:52:02 UTC Comment hidden (obsolete)
Comment 12 Kyle M Hall 2019-04-01 10:52:11 UTC Comment hidden (obsolete)
Comment 13 Kyle M Hall 2019-04-01 10:52:14 UTC Comment hidden (obsolete)
Comment 14 Kyle M Hall 2019-04-01 10:52:17 UTC Comment hidden (obsolete)
Comment 15 Kyle M Hall 2019-04-01 10:52:20 UTC Comment hidden (obsolete)
Comment 16 Kyle M Hall 2019-04-01 10:52:23 UTC Comment hidden (obsolete)
Comment 17 Kyle M Hall 2019-04-01 10:52:25 UTC Comment hidden (obsolete)
Comment 18 Kyle M Hall 2019-04-01 10:52:28 UTC Comment hidden (obsolete)
Comment 19 Kyle M Hall 2019-04-23 16:39:19 UTC Comment hidden (obsolete)
Comment 20 Kyle M Hall 2019-04-23 16:40:47 UTC Comment hidden (obsolete)
Comment 21 Kyle M Hall 2019-04-23 16:40:54 UTC Comment hidden (obsolete)
Comment 22 Kyle M Hall 2019-04-23 16:40:56 UTC Comment hidden (obsolete)
Comment 23 Kyle M Hall 2019-04-23 16:40:59 UTC Comment hidden (obsolete)
Comment 24 Kyle M Hall 2019-04-23 16:41:02 UTC Comment hidden (obsolete)
Comment 25 Kyle M Hall 2019-04-23 16:41:04 UTC Comment hidden (obsolete)
Comment 26 Kyle M Hall 2019-04-23 16:41:07 UTC Comment hidden (obsolete)
Comment 27 Kyle M Hall 2019-04-23 16:41:10 UTC Comment hidden (obsolete)
Comment 28 Josef Moravec 2019-04-24 13:11:15 UTC Comment hidden (obsolete)
Comment 29 Josef Moravec 2019-04-24 13:12:23 UTC
Comment on attachment 88543 [details] [review]
Bug 20256: Add new methods for checking item editing permissions

Review of attachment 88543 [details] [review]:
-----------------------------------------------------------------

::: Koha/Patron.pm
@@ +1147,5 @@
>  }
>  
> +=head3 libraries_where_can_see_patrons
> +
> +my $libraries = $patron-libraries_where_can_see_patrons;

Should be
$patron->libraries_where_can_see_patrons;

missing ">" character
Comment 30 Josef Moravec 2019-04-24 13:25:56 UTC
I think it is great enhancement, just need to polish some little issues ;)
Comment 31 Kyle M Hall 2019-04-24 15:03:11 UTC
Comment on attachment 88546 [details] [review]
Bug 20256: Use new methods

Review of attachment 88546 [details] [review]:
-----------------------------------------------------------------

::: C4/Items.pm
@@ +1746,4 @@
>          $status = "book_on_loan";
>      }
>      elsif ( defined C4::Context->userenv
> +         and !Koha::Patrons->find( C4::Context->userenv->{number} )->can_edit_item( $item ) )

cli scripts have no userenv, so this is cli safe.

::: catalogue/detail.pl
@@ +340,4 @@
>          $item->{'course_reserves'} = GetItemCourseReservesInfo( itemnumber => $item->{'itemnumber'} );
>      }
>  
> +    $item->{cannot_be_edited} = !$patron->can_edit_item( $item_object );

Fair enough. I'll submit a followup for fix that!
Comment 32 Kyle M Hall 2019-04-24 15:05:02 UTC Comment hidden (obsolete)
Comment 33 Josef Moravec 2019-04-25 06:05:27 UTC
(In reply to Kyle M Hall from comment #31)
> Comment on attachment 88546 [details] [review] [review]
> Bug 20256: Use new methods
> 
> Review of attachment 88546 [details] [review] [review]:
> -----------------------------------------------------------------
> 
> ::: C4/Items.pm
> @@ +1746,4 @@
> >          $status = "book_on_loan";
> >      }
> >      elsif ( defined C4::Context->userenv
> > +         and !Koha::Patrons->find( C4::Context->userenv->{number} )->can_edit_item( $item ) )
> 
> cli scripts have no userenv, so this is cli safe.


Sorry, I totally misread the code, you are right
Comment 34 Josef Moravec 2019-04-25 07:10:45 UTC Comment hidden (obsolete)
Comment 35 Josef Moravec 2019-04-25 07:48:08 UTC Comment hidden (obsolete)
Comment 36 Josef Moravec 2019-04-25 07:48:12 UTC Comment hidden (obsolete)
Comment 37 Josef Moravec 2019-04-25 07:48:15 UTC Comment hidden (obsolete)
Comment 38 Josef Moravec 2019-04-25 07:48:18 UTC Comment hidden (obsolete)
Comment 39 Josef Moravec 2019-04-25 07:52:05 UTC
(In reply to Josef Moravec from comment #33)
> (In reply to Kyle M Hall from comment #31)
> > Comment on attachment 88546 [details] [review] [review] [review]
> > Bug 20256: Use new methods
> > 
> > Review of attachment 88546 [details] [review] [review] [review]:
> > -----------------------------------------------------------------
> > 
> > ::: C4/Items.pm
> > @@ +1746,4 @@
> > >          $status = "book_on_loan";
> > >      }
> > >      elsif ( defined C4::Context->userenv
> > > +         and !Koha::Patrons->find( C4::Context->userenv->{number} )->can_edit_item( $item ) )
> > 
> > cli scripts have no userenv, so this is cli safe.
> 
> 
> Sorry, I totally misread the code, you are right

I misread the code, but it is still valid, since bug 22600 added userenv to commandline/cron scripts...

I added follow-up for this and for some other minor issues.

But there is still one bigger problem: On biblio detail page, the checkbox is shown only when user can edit the item, but the edit button in the most right column of items table does not respect this logic. Even worse, I am able to edit the item, when i click it or reach the edit item form directly. This should be fixed on module level I think...
Comment 40 Kyle M Hall 2019-04-26 14:59:37 UTC Comment hidden (obsolete)
Comment 41 Kyle M Hall 2019-04-26 14:59:47 UTC Comment hidden (obsolete)
Comment 42 Jonathan Druart 2019-05-08 19:16:06 UTC
Quick review:

1. ->can_edit_item
    if ( C4::Context->preference('IndependentBranches') ) {
        return $userenv->{branch} eq $branchcode;
    }    

We certainly want to handle non-existing $userenv


2. On update, should not we set edit_any_item for patrons who where already allowed to edit items?

3. on /cataloguing/additem.pl, the whole dropdown list (edit, delete, print, etc.) is not displayed, I would expect to see some of them

4. You can add items to other libraries but then you cannot longer edit them?
Maybe add and update should be impacted by this change?

5. Restriction is only done at template level (at least for batchMod), there should be a low level exception raised if the logged in user is trying to edit/delete (add?) an item outside of their group.
Comment 43 Katrin Fischer 2019-05-11 20:14:29 UTC
Patches still apply, QA tools look good. Can you please take a look at Joubu's questions on comment 42? I think it would be nice to also limit update and add... as otherwise this leaves potential for 'locking yourself out' of an item you just added.
Comment 44 Kyle M Hall 2019-12-05 12:05:51 UTC Comment hidden (obsolete)
Comment 45 Kyle M Hall 2019-12-05 12:06:24 UTC Comment hidden (obsolete)
Comment 46 Kyle M Hall 2019-12-05 12:06:33 UTC Comment hidden (obsolete)
Comment 47 Kyle M Hall 2019-12-05 12:06:37 UTC Comment hidden (obsolete)
Comment 48 Kyle M Hall 2019-12-05 12:06:41 UTC Comment hidden (obsolete)
Comment 49 Kyle M Hall 2019-12-05 12:06:44 UTC Comment hidden (obsolete)
Comment 50 Kyle M Hall 2019-12-05 12:06:48 UTC Comment hidden (obsolete)
Comment 51 Kyle M Hall 2019-12-05 12:06:52 UTC Comment hidden (obsolete)
Comment 52 Kyle M Hall 2019-12-05 12:06:55 UTC Comment hidden (obsolete)
Comment 53 Kyle M Hall 2019-12-05 12:06:58 UTC Comment hidden (obsolete)
Comment 54 Kyle M Hall 2019-12-05 12:07:02 UTC Comment hidden (obsolete)
Comment 55 Kyle M Hall 2019-12-05 12:07:05 UTC Comment hidden (obsolete)
Comment 56 Kyle M Hall 2019-12-05 12:07:08 UTC Comment hidden (obsolete)
Comment 57 Kyle M Hall 2019-12-05 12:07:11 UTC Comment hidden (obsolete)
Comment 58 Kyle M Hall 2019-12-05 12:07:15 UTC Comment hidden (obsolete)
Comment 59 Kyle M Hall 2019-12-05 12:07:18 UTC Comment hidden (obsolete)
Comment 60 Kyle M Hall 2019-12-05 12:07:21 UTC Comment hidden (obsolete)
Comment 61 Kyle M Hall 2019-12-05 12:07:24 UTC Comment hidden (obsolete)
Comment 62 Kyle M Hall 2019-12-05 12:07:27 UTC Comment hidden (obsolete)
Comment 63 Jonathan Druart 2019-12-05 14:16:37 UTC
Hi Kyle,

I am not able to test:
Can't call method "libraries_where_can_edit_items" on an undefined value at /kohadevbox/koha/cataloguing/additem.pl line 178

Also, do not you think "edit_any_items" description should refer to "libraries in the same group" and not only "home library"?
Comment 64 Jonathan Druart 2019-12-10 14:18:39 UTC
*** Bug 22923 has been marked as a duplicate of this bug. ***
Comment 65 Kyle M Hall 2020-04-09 14:42:54 UTC Comment hidden (obsolete)
Comment 66 Kyle M Hall 2020-04-09 14:44:51 UTC Comment hidden (obsolete)
Comment 67 Kyle M Hall 2020-04-09 14:45:11 UTC
Created attachment 102624 [details] [review]
Bug 20256: Update database

Test Plan:
1) Apply this patch set
2) Run updatedatabase.pl
3) Create two library groups with some libraries in them,
   make sure to enable the new feature to limit editing of items
4) Test the functionality, if an item is owned by a library in
   your group, you should have full editing abilities. If an item
   is from a different group, you should only be able to make the
   same changes you would be able to if IndependentBranches were.
Comment 68 Kyle M Hall 2020-04-09 14:45:24 UTC
Created attachment 102625 [details] [review]
Bug 20256: Add new permission to editor
Comment 69 Kyle M Hall 2020-04-09 14:45:28 UTC
Created attachment 102626 [details] [review]
Bug 20256: Refactor subs for rights to view patrons to make them generic for general use
Comment 70 Kyle M Hall 2020-04-09 14:45:31 UTC
Created attachment 102627 [details] [review]
Bug 20256: Add new methods for checking item editing permissions
Comment 71 Kyle M Hall 2020-04-09 14:45:35 UTC
Created attachment 102628 [details] [review]
Bug 20256: Update groups editor
Comment 72 Kyle M Hall 2020-04-09 14:45:39 UTC
Created attachment 102629 [details] [review]
Bug 20256: Use new methods
Comment 73 Kyle M Hall 2020-04-09 14:45:42 UTC
Created attachment 102630 [details] [review]
Bug 20256: Add unit tests
Comment 74 Kyle M Hall 2020-04-09 14:45:46 UTC
Created attachment 102631 [details] [review]
Bug 20256: (QA follow-up) Remove double negative from code
Comment 75 Kyle M Hall 2020-04-09 14:45:49 UTC
Created attachment 102632 [details] [review]
Bug 20256: (QA follow-up) Change meaning should change code
Comment 76 Kyle M Hall 2020-04-09 14:45:53 UTC
Created attachment 102633 [details] [review]
Bug 20256: (QA follow-up) test borrowernumber in userenv too

Bug 22600 added userenv for scripts, so userenv is defined, but some of
values in userenv not

Test plan:
Run with some params: misc/cronjobs/delete_items.pl

--> without this patch you will se error message:
    Can't call method "can_edit_item" on an undefined value at /home/vagrant/kohaclone/C4/Items.pm line 1748
--> with this patch everything works smoothly
Comment 77 Kyle M Hall 2020-04-09 14:45:56 UTC
Created attachment 102634 [details] [review]
Bug 20256: (QA follow-up) Fix column description for ft_limit_item_editing
Comment 78 Kyle M Hall 2020-04-09 14:46:00 UTC
Created attachment 102635 [details] [review]
Bug 20256: (QA follow-up) Fix missed change from item.cannot_be_edited to item.can_be_edited
Comment 79 Kyle M Hall 2020-04-09 14:46:04 UTC
Created attachment 102636 [details] [review]
Bug 20256: (QA follow-up) Redirect to record details page if user cannot edit this item
Comment 80 Kyle M Hall 2020-04-09 14:46:08 UTC
Created attachment 102637 [details] [review]
Bug 20256: (QA follow-up) Handle non-existing userenv
Comment 81 Kyle M Hall 2020-04-09 14:46:12 UTC
Created attachment 102638 [details] [review]
Bug 20256: (QA follow-up) Give existing users with edit_items permission edit_any_item as well
Comment 82 Kyle M Hall 2020-04-09 14:46:15 UTC
Created attachment 102639 [details] [review]
Bug 20256: (QA follow-up) Skip batch editing items the user is not allowed to edit
Comment 83 Kyle M Hall 2020-04-09 14:46:19 UTC
Created attachment 102640 [details] [review]
Bug 20256: (QA follow-up) Filter out branchcodes the user has no permissions for
Comment 84 Kyle M Hall 2020-04-09 14:46:22 UTC
Created attachment 102641 [details] [review]
Bug 20256: Mark ft_limit_item_editing as boolean in schema file
Comment 85 Kyle M Hall 2020-04-09 14:46:26 UTC
Created attachment 102642 [details] [review]
Bug 20256: Update DB Schema [DO NOT PUSH]
Comment 86 Owen Leonard 2020-04-10 11:35:29 UTC
In my tests this is working correctly. I would like to have a more thorough test plan because I worry I was missing something I should have been looking at.

However, there are a couple of complaints by the QA tool which need to be addressed.
Comment 87 Kyle M Hall 2020-04-10 13:08:11 UTC
Created attachment 102703 [details] [review]
Bug 20256: Update database

Test Plan:
1) Apply this patch set
2) Run updatedatabase.pl
3) Create two library groups with some libraries in them,
   make sure to enable the new feature to limit editing of items
4) Test the functionality, if an item is owned by a library in
   your group, you should have full editing abilities. If an item
   is from a different group, you should only be able to make the
   same changes you would be able to if IndependentBranches were.
Comment 88 Kyle M Hall 2020-04-10 13:08:36 UTC
Created attachment 102704 [details] [review]
Bug 20256: Update database

Test Plan:
1) Apply this patch set
2) Run updatedatabase.pl
3) Create two library groups with some libraries in them,
   make sure to enable the new feature to limit editing of items
4) Test the functionality, if an item is owned by a library in
   your group, you should have full editing abilities. If an item
   is from a different group, you should only be able to make the
   same changes you would be able to if IndependentBranches were.
Comment 89 Kyle M Hall 2020-04-10 13:08:51 UTC
Created attachment 102705 [details] [review]
Bug 20256: Add new permission to editor
Comment 90 Kyle M Hall 2020-04-10 13:08:56 UTC
Created attachment 102706 [details] [review]
Bug 20256: Refactor subs for rights to view patrons to make them generic for general use
Comment 91 Kyle M Hall 2020-04-10 13:09:00 UTC
Created attachment 102707 [details] [review]
Bug 20256: Add new methods for checking item editing permissions
Comment 92 Kyle M Hall 2020-04-10 13:09:04 UTC
Created attachment 102708 [details] [review]
Bug 20256: Update groups editor
Comment 93 Kyle M Hall 2020-04-10 13:09:08 UTC
Created attachment 102709 [details] [review]
Bug 20256: Use new methods
Comment 94 Kyle M Hall 2020-04-10 13:09:12 UTC
Created attachment 102710 [details] [review]
Bug 20256: Add unit tests
Comment 95 Kyle M Hall 2020-04-10 13:09:16 UTC
Created attachment 102711 [details] [review]
Bug 20256: (QA follow-up) Remove double negative from code
Comment 96 Kyle M Hall 2020-04-10 13:09:20 UTC
Created attachment 102712 [details] [review]
Bug 20256: (QA follow-up) Change meaning should change code
Comment 97 Kyle M Hall 2020-04-10 13:09:25 UTC
Created attachment 102713 [details] [review]
Bug 20256: (QA follow-up) test borrowernumber in userenv too

Bug 22600 added userenv for scripts, so userenv is defined, but some of
values in userenv not

Test plan:
Run with some params: misc/cronjobs/delete_items.pl

--> without this patch you will se error message:
    Can't call method "can_edit_item" on an undefined value at /home/vagrant/kohaclone/C4/Items.pm line 1748
--> with this patch everything works smoothly
Comment 98 Kyle M Hall 2020-04-10 13:09:29 UTC
Created attachment 102714 [details] [review]
Bug 20256: (QA follow-up) Fix column description for ft_limit_item_editing
Comment 99 Kyle M Hall 2020-04-10 13:09:32 UTC
Created attachment 102715 [details] [review]
Bug 20256: (QA follow-up) Fix missed change from item.cannot_be_edited to item.can_be_edited
Comment 100 Kyle M Hall 2020-04-10 13:09:36 UTC
Created attachment 102716 [details] [review]
Bug 20256: (QA follow-up) Redirect to record details page if user cannot edit this item
Comment 101 Kyle M Hall 2020-04-10 13:09:40 UTC
Created attachment 102717 [details] [review]
Bug 20256: (QA follow-up) Handle non-existing userenv
Comment 102 Kyle M Hall 2020-04-10 13:09:44 UTC
Created attachment 102718 [details] [review]
Bug 20256: (QA follow-up) Give existing users with edit_items permission edit_any_item as well
Comment 103 Kyle M Hall 2020-04-10 13:09:48 UTC
Created attachment 102719 [details] [review]
Bug 20256: (QA follow-up) Skip batch editing items the user is not allowed to edit
Comment 104 Kyle M Hall 2020-04-10 13:09:52 UTC
Created attachment 102720 [details] [review]
Bug 20256: (QA follow-up) Filter out branchcodes the user has no permissions for
Comment 105 Kyle M Hall 2020-04-10 13:09:56 UTC
Created attachment 102721 [details] [review]
Bug 20256: Mark ft_limit_item_editing as boolean in schema file
Comment 106 Kyle M Hall 2020-04-10 13:10:00 UTC
Created attachment 102722 [details] [review]
Bug 20256: Update DB Schema [DO NOT PUSH]
Comment 107 Kyle M Hall 2020-04-10 16:28:51 UTC
Test Plan:
* Apply this patch set
* Run updatedatabase.pl
* Restart all the things!
* Create two library groups with half the libraries in each
* Enable the new item editing limits for the groups
* Note you can now only edit items from the same group as your logged in users home library
* Verify you cannot edit other library group's items using the batch item editor
* Give your user the new "edit_any_item" user permission, verify the user can now edit any item
Comment 108 Kyle M Hall 2020-04-10 16:31:10 UTC
Created attachment 102732 [details] [review]
Bug 20256: Update database

Test Plan:
1) Apply this patch set
2) Run updatedatabase.pl
3) Create two library groups with some libraries in them,
   make sure to enable the new feature to limit editing of items
4) Test the functionality, if an item is owned by a library in
   your group, you should have full editing abilities. If an item
   is from a different group, you should only be able to make the
   same changes you would be able to if IndependentBranches were.

Signed-off-by: Bob Bennhoff - CLiC <bbennhoff@clicweb.org>
Comment 109 Kyle M Hall 2020-04-10 16:31:46 UTC
Created attachment 102733 [details] [review]
Bug 20256: Update database

Test Plan:
1) Apply this patch set
2) Run updatedatabase.pl
3) Create two library groups with some libraries in them,
   make sure to enable the new feature to limit editing of items
4) Test the functionality, if an item is owned by a library in
   your group, you should have full editing abilities. If an item
   is from a different group, you should only be able to make the
   same changes you would be able to if IndependentBranches were.

Signed-off-by: Bob Bennhoff - CLiC <bbennhoff@clicweb.org>
Comment 110 Kyle M Hall 2020-04-10 16:31:56 UTC
Created attachment 102734 [details] [review]
Bug 20256: Add new permission to editor

Signed-off-by: Bob Bennhoff - CLiC <bbennhoff@clicweb.org>
Comment 111 Kyle M Hall 2020-04-10 16:32:00 UTC
Created attachment 102735 [details] [review]
Bug 20256: Refactor subs for rights to view patrons to make them generic for general use

Signed-off-by: Bob Bennhoff - CLiC <bbennhoff@clicweb.org>
Comment 112 Kyle M Hall 2020-04-10 16:32:04 UTC
Created attachment 102736 [details] [review]
Bug 20256: Add new methods for checking item editing permissions

Signed-off-by: Bob Bennhoff - CLiC <bbennhoff@clicweb.org>
Comment 113 Kyle M Hall 2020-04-10 16:32:08 UTC
Created attachment 102737 [details] [review]
Bug 20256: Update groups editor

Signed-off-by: Bob Bennhoff - CLiC <bbennhoff@clicweb.org>
Comment 114 Kyle M Hall 2020-04-10 16:32:12 UTC
Created attachment 102738 [details] [review]
Bug 20256: Use new methods

Signed-off-by: Bob Bennhoff - CLiC <bbennhoff@clicweb.org>
Comment 115 Kyle M Hall 2020-04-10 16:32:16 UTC
Created attachment 102739 [details] [review]
Bug 20256: Add unit tests

Signed-off-by: Bob Bennhoff - CLiC <bbennhoff@clicweb.org>
Comment 116 Kyle M Hall 2020-04-10 16:32:21 UTC
Created attachment 102740 [details] [review]
Bug 20256: (QA follow-up) Remove double negative from code

Signed-off-by: Bob Bennhoff - CLiC <bbennhoff@clicweb.org>
Comment 117 Kyle M Hall 2020-04-10 16:32:26 UTC
Created attachment 102741 [details] [review]
Bug 20256: (QA follow-up) Change meaning should change code

Signed-off-by: Bob Bennhoff - CLiC <bbennhoff@clicweb.org>
Comment 118 Kyle M Hall 2020-04-10 16:32:31 UTC
Created attachment 102742 [details] [review]
Bug 20256: (QA follow-up) test borrowernumber in userenv too

Bug 22600 added userenv for scripts, so userenv is defined, but some of
values in userenv not

Test plan:
Run with some params: misc/cronjobs/delete_items.pl

--> without this patch you will se error message:
    Can't call method "can_edit_item" on an undefined value at /home/vagrant/kohaclone/C4/Items.pm line 1748
--> with this patch everything works smoothly

Signed-off-by: Bob Bennhoff - CLiC <bbennhoff@clicweb.org>
Comment 119 Kyle M Hall 2020-04-10 16:32:35 UTC
Created attachment 102743 [details] [review]
Bug 20256: (QA follow-up) Fix column description for ft_limit_item_editing

Signed-off-by: Bob Bennhoff - CLiC <bbennhoff@clicweb.org>
Comment 120 Kyle M Hall 2020-04-10 16:32:40 UTC
Created attachment 102744 [details] [review]
Bug 20256: (QA follow-up) Fix missed change from item.cannot_be_edited to item.can_be_edited

Signed-off-by: Bob Bennhoff - CLiC <bbennhoff@clicweb.org>
Comment 121 Kyle M Hall 2020-04-10 16:32:44 UTC
Created attachment 102745 [details] [review]
Bug 20256: (QA follow-up) Redirect to record details page if user cannot edit this item

Signed-off-by: Bob Bennhoff - CLiC <bbennhoff@clicweb.org>
Comment 122 Kyle M Hall 2020-04-10 16:32:48 UTC
Created attachment 102746 [details] [review]
Bug 20256: (QA follow-up) Handle non-existing userenv

Signed-off-by: Bob Bennhoff - CLiC <bbennhoff@clicweb.org>
Comment 123 Kyle M Hall 2020-04-10 16:32:52 UTC
Created attachment 102747 [details] [review]
Bug 20256: (QA follow-up) Give existing users with edit_items permission edit_any_item as well

Signed-off-by: Bob Bennhoff - CLiC <bbennhoff@clicweb.org>
Comment 124 Kyle M Hall 2020-04-10 16:32:56 UTC
Created attachment 102748 [details] [review]
Bug 20256: (QA follow-up) Skip batch editing items the user is not allowed to edit

Signed-off-by: Bob Bennhoff - CLiC <bbennhoff@clicweb.org>
Comment 125 Kyle M Hall 2020-04-10 16:33:01 UTC
Created attachment 102749 [details] [review]
Bug 20256: (QA follow-up) Filter out branchcodes the user has no permissions for

Signed-off-by: Bob Bennhoff - CLiC <bbennhoff@clicweb.org>
Comment 126 Kyle M Hall 2020-04-10 16:33:05 UTC
Created attachment 102750 [details] [review]
Bug 20256: Mark ft_limit_item_editing as boolean in schema file

Signed-off-by: Bob Bennhoff - CLiC <bbennhoff@clicweb.org>
Comment 127 Kyle M Hall 2020-04-10 16:33:09 UTC
Created attachment 102751 [details] [review]
Bug 20256: Update DB Schema [DO NOT PUSH]

Signed-off-by: Bob Bennhoff - CLiC <bbennhoff@clicweb.org>
Comment 128 Katrin Fischer 2020-07-05 01:11:09 UTC
Patches curently no longer apply, can you please rebase?

Apply? [(y)es, (n)o, (i)nteractive] y
Applying: Bug 20256: Update database
Applying: Bug 20256: Add new permission to editor
Applying: Bug 20256: Refactor subs for rights to view patrons to make them generic for general use
Applying: Bug 20256: Add new methods for checking item editing permissions
Applying: Bug 20256: Update groups editor
Applying: Bug 20256: Use new methods
Applying: Bug 20256: Add unit tests
Using index info to reconstruct a base tree...
M	t/db_dependent/Koha/Patrons.t
Falling back to patching base and 3-way merge...
Auto-merging t/db_dependent/Koha/Patrons.t
Applying: Bug 20256: (QA follow-up) Remove double negative from code
Applying: Bug 20256: (QA follow-up) Change meaning should change code
Applying: Bug 20256: (QA follow-up) test borrowernumber in userenv too
Applying: Bug 20256: (QA follow-up) Fix column description for ft_limit_item_editing
Applying: Bug 20256: (QA follow-up) Fix missed change from item.cannot_be_edited to item.can_be_edited
Applying: Bug 20256: (QA follow-up) Redirect to record details page if user cannot edit this item
Applying: Bug 20256: (QA follow-up) Handle non-existing userenv
Applying: Bug 20256: (QA follow-up) Give existing users with edit_items permission edit_any_item as well
Applying: Bug 20256: (QA follow-up) Skip batch editing items the user is not allowed to edit
.git/rebase-apply/patch:14: trailing whitespace.
	my $i = 1; 
error: sha1 information is lacking or useless (tools/batchMod.pl).
error: could not build fake ancestor
Patch failed at 0001 Bug 20256: (QA follow-up) Skip batch editing items the user is not allowed to edit
The copy of the patch that failed is found in: .git/rebase-apply/patch
When you have resolved this problem run "git bz apply --continue".
If you would prefer to skip this patch, instead run "git bz apply --skip".
To restore the original branch and stop patching run "git bz apply --abort".
Patch left in /tmp/Bug-20256-QA-follow-up-Skip-batch-editing-items-th-PQV8Ge.patch
Comment 129 Kyle M Hall 2020-07-24 11:34:51 UTC
Created attachment 107312 [details] [review]
Bug 20256: Update database

Test Plan:
1) Apply this patch set
2) Run updatedatabase.pl
3) Create two library groups with some libraries in them,
   make sure to enable the new feature to limit editing of items
4) Test the functionality, if an item is owned by a library in
   your group, you should have full editing abilities. If an item
   is from a different group, you should only be able to make the
   same changes you would be able to if IndependentBranches were.

Signed-off-by: Bob Bennhoff - CLiC <bbennhoff@clicweb.org>
Comment 130 Kyle M Hall 2020-07-24 11:35:01 UTC
Created attachment 107313 [details] [review]
Bug 20256: Add new permission to editor

Signed-off-by: Bob Bennhoff - CLiC <bbennhoff@clicweb.org>
Comment 131 Kyle M Hall 2020-07-24 11:35:06 UTC
Created attachment 107314 [details] [review]
Bug 20256: Refactor subs for rights to view patrons to make them generic for general use

Signed-off-by: Bob Bennhoff - CLiC <bbennhoff@clicweb.org>
Comment 132 Kyle M Hall 2020-07-24 11:35:10 UTC
Created attachment 107315 [details] [review]
Bug 20256: Add new methods for checking item editing permissions

Signed-off-by: Bob Bennhoff - CLiC <bbennhoff@clicweb.org>
Comment 133 Kyle M Hall 2020-07-24 11:35:14 UTC
Created attachment 107316 [details] [review]
Bug 20256: Update groups editor

Signed-off-by: Bob Bennhoff - CLiC <bbennhoff@clicweb.org>
Comment 134 Kyle M Hall 2020-07-24 11:35:20 UTC
Created attachment 107317 [details] [review]
Bug 20256: Use new methods

Signed-off-by: Bob Bennhoff - CLiC <bbennhoff@clicweb.org>
Comment 135 Kyle M Hall 2020-07-24 11:35:24 UTC
Created attachment 107318 [details] [review]
Bug 20256: Add unit tests

Signed-off-by: Bob Bennhoff - CLiC <bbennhoff@clicweb.org>
Comment 136 Kyle M Hall 2020-07-24 11:35:30 UTC
Created attachment 107319 [details] [review]
Bug 20256: (QA follow-up) Remove double negative from code

Signed-off-by: Bob Bennhoff - CLiC <bbennhoff@clicweb.org>
Comment 137 Kyle M Hall 2020-07-24 11:35:34 UTC
Created attachment 107320 [details] [review]
Bug 20256: (QA follow-up) Change meaning should change code

Signed-off-by: Bob Bennhoff - CLiC <bbennhoff@clicweb.org>
Comment 138 Kyle M Hall 2020-07-24 11:35:39 UTC
Created attachment 107321 [details] [review]
Bug 20256: (QA follow-up) test borrowernumber in userenv too

Bug 22600 added userenv for scripts, so userenv is defined, but some of
values in userenv not

Test plan:
Run with some params: misc/cronjobs/delete_items.pl

--> without this patch you will se error message:
    Can't call method "can_edit_item" on an undefined value at /home/vagrant/kohaclone/C4/Items.pm line 1748
--> with this patch everything works smoothly

Signed-off-by: Bob Bennhoff - CLiC <bbennhoff@clicweb.org>
Comment 139 Kyle M Hall 2020-07-24 11:35:43 UTC
Created attachment 107322 [details] [review]
Bug 20256: (QA follow-up) Fix column description for ft_limit_item_editing

Signed-off-by: Bob Bennhoff - CLiC <bbennhoff@clicweb.org>
Comment 140 Kyle M Hall 2020-07-24 11:35:48 UTC
Created attachment 107323 [details] [review]
Bug 20256: (QA follow-up) Fix missed change from item.cannot_be_edited to item.can_be_edited

Signed-off-by: Bob Bennhoff - CLiC <bbennhoff@clicweb.org>
Comment 141 Kyle M Hall 2020-07-24 11:35:51 UTC
Created attachment 107324 [details] [review]
Bug 20256: (QA follow-up) Redirect to record details page if user cannot edit this item

Signed-off-by: Bob Bennhoff - CLiC <bbennhoff@clicweb.org>
Comment 142 Kyle M Hall 2020-07-24 11:35:56 UTC
Created attachment 107325 [details] [review]
Bug 20256: (QA follow-up) Handle non-existing userenv

Signed-off-by: Bob Bennhoff - CLiC <bbennhoff@clicweb.org>
Comment 143 Kyle M Hall 2020-07-24 11:36:01 UTC
Created attachment 107326 [details] [review]
Bug 20256: (QA follow-up) Give existing users with edit_items permission edit_any_item as well

Signed-off-by: Bob Bennhoff - CLiC <bbennhoff@clicweb.org>
Comment 144 Kyle M Hall 2020-07-24 11:36:05 UTC
Created attachment 107327 [details] [review]
Bug 20256: (QA follow-up) Skip batch editing items the user is not allowed to edit

Signed-off-by: Bob Bennhoff - CLiC <bbennhoff@clicweb.org>
Comment 145 Kyle M Hall 2020-07-24 11:36:10 UTC
Created attachment 107328 [details] [review]
Bug 20256: (QA follow-up) Filter out branchcodes the user has no permissions for

Signed-off-by: Bob Bennhoff - CLiC <bbennhoff@clicweb.org>
Comment 146 Kyle M Hall 2020-07-24 11:36:14 UTC
Created attachment 107329 [details] [review]
Bug 20256: Mark ft_limit_item_editing as boolean in schema file

Signed-off-by: Bob Bennhoff - CLiC <bbennhoff@clicweb.org>
Comment 147 Kyle M Hall 2020-07-24 11:36:18 UTC
Created attachment 107330 [details] [review]
Bug 20256: Update DB Schema [DO NOT PUSH]

Signed-off-by: Bob Bennhoff - CLiC <bbennhoff@clicweb.org>
Comment 148 Katrin Fischer 2020-08-16 22:22:14 UTC
This no longer applies, please rebase!

Apply? [(y)es, (n)o, (i)nteractive] y
Applying: Bug 20256: Update database
Applying: Bug 20256: Add new permission to editor
Applying: Bug 20256: Refactor subs for rights to view patrons to make them generic for general use
Applying: Bug 20256: Add new methods for checking item editing permissions
Applying: Bug 20256: Update groups editor
Applying: Bug 20256: Use new methods
Using index info to reconstruct a base tree...
M	Koha/Item.pm
M	catalogue/detail.pl
M	catalogue/moredetail.pl
M	cataloguing/additem.pl
M	koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt
M	tools/batchMod.pl
Falling back to patching base and 3-way merge...
Auto-merging tools/batchMod.pl
Auto-merging koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt
Auto-merging cataloguing/additem.pl
Auto-merging catalogue/moredetail.pl
Auto-merging catalogue/detail.pl
Auto-merging Koha/Item.pm
Applying: Bug 20256: Add unit tests
Applying: Bug 20256: (QA follow-up) Remove double negative from code
Applying: Bug 20256: (QA follow-up) Change meaning should change code
Applying: Bug 20256: (QA follow-up) test borrowernumber in userenv too
Applying: Bug 20256: (QA follow-up) Fix column description for ft_limit_item_editing
Applying: Bug 20256: (QA follow-up) Fix missed change from item.cannot_be_edited to item.can_be_edited
Applying: Bug 20256: (QA follow-up) Redirect to record details page if user cannot edit this item
error: sha1 information is lacking or useless (cataloguing/additem.pl).
error: could not build fake ancestor
Patch failed at 0001 Bug 20256: (QA follow-up) Redirect to record details page if user cannot edit this item
The copy of the patch that failed is found in: .git/rebase-apply/patch
When you have resolved this problem run "git bz apply --continue".
If you would prefer to skip this patch, instead run "git bz apply --skip".
To restore the original branch and stop patching run "git bz apply --abort".
Patch left in /tmp/Bug-20256-QA-follow-up-Redirect-to-record-details--3RxR9W.patch
Comment 149 Kyle M Hall 2020-08-21 18:17:24 UTC
Created attachment 108851 [details] [review]
Bug 20256: Update database

Test Plan:
1) Apply this patch set
2) Run updatedatabase.pl
3) Create two library groups with some libraries in them,
   make sure to enable the new feature to limit editing of items
4) Test the functionality, if an item is owned by a library in
   your group, you should have full editing abilities. If an item
   is from a different group, you should only be able to make the
   same changes you would be able to if IndependentBranches were.

Signed-off-by: Bob Bennhoff - CLiC <bbennhoff@clicweb.org>
Comment 150 Kyle M Hall 2020-08-21 18:19:34 UTC
Created attachment 108852 [details] [review]
Bug 20256: Update database

Test Plan:
1) Apply this patch set
2) Run updatedatabase.pl
3) Create two library groups with some libraries in them,
   make sure to enable the new feature to limit editing of items
4) Test the functionality, if an item is owned by a library in
   your group, you should have full editing abilities. If an item
   is from a different group, you should only be able to make the
   same changes you would be able to if IndependentBranches were.

Signed-off-by: Bob Bennhoff - CLiC <bbennhoff@clicweb.org>
Comment 151 Kyle M Hall 2020-08-21 18:19:46 UTC
Created attachment 108853 [details] [review]
Bug 20256: Add new permission to editor

Signed-off-by: Bob Bennhoff - CLiC <bbennhoff@clicweb.org>
Comment 152 Kyle M Hall 2020-08-21 18:19:52 UTC
Created attachment 108854 [details] [review]
Bug 20256: Refactor subs for rights to view patrons to make them generic for general use

Signed-off-by: Bob Bennhoff - CLiC <bbennhoff@clicweb.org>
Comment 153 Kyle M Hall 2020-08-21 18:19:56 UTC
Created attachment 108855 [details] [review]
Bug 20256: Add new methods for checking item editing permissions

Signed-off-by: Bob Bennhoff - CLiC <bbennhoff@clicweb.org>
Comment 154 Kyle M Hall 2020-08-21 18:20:02 UTC
Created attachment 108856 [details] [review]
Bug 20256: Update groups editor

Signed-off-by: Bob Bennhoff - CLiC <bbennhoff@clicweb.org>
Comment 155 Kyle M Hall 2020-08-21 18:20:06 UTC
Created attachment 108857 [details] [review]
Bug 20256: Use new methods

Signed-off-by: Bob Bennhoff - CLiC <bbennhoff@clicweb.org>
Comment 156 Kyle M Hall 2020-08-21 18:20:11 UTC
Created attachment 108858 [details] [review]
Bug 20256: Add unit tests

Signed-off-by: Bob Bennhoff - CLiC <bbennhoff@clicweb.org>
Comment 157 Kyle M Hall 2020-08-21 18:20:16 UTC
Created attachment 108859 [details] [review]
Bug 20256: (QA follow-up) Remove double negative from code

Signed-off-by: Bob Bennhoff - CLiC <bbennhoff@clicweb.org>
Comment 158 Kyle M Hall 2020-08-21 18:20:20 UTC
Created attachment 108860 [details] [review]
Bug 20256: (QA follow-up) Change meaning should change code

Signed-off-by: Bob Bennhoff - CLiC <bbennhoff@clicweb.org>
Comment 159 Kyle M Hall 2020-08-21 18:20:26 UTC
Created attachment 108861 [details] [review]
Bug 20256: (QA follow-up) test borrowernumber in userenv too

Bug 22600 added userenv for scripts, so userenv is defined, but some of
values in userenv not

Test plan:
Run with some params: misc/cronjobs/delete_items.pl

--> without this patch you will se error message:
    Can't call method "can_edit_item" on an undefined value at /home/vagrant/kohaclone/C4/Items.pm line 1748
--> with this patch everything works smoothly

Signed-off-by: Bob Bennhoff - CLiC <bbennhoff@clicweb.org>
Comment 160 Kyle M Hall 2020-08-21 18:20:31 UTC
Created attachment 108862 [details] [review]
Bug 20256: (QA follow-up) Fix column description for ft_limit_item_editing

Signed-off-by: Bob Bennhoff - CLiC <bbennhoff@clicweb.org>
Comment 161 Kyle M Hall 2020-08-21 18:20:35 UTC
Created attachment 108863 [details] [review]
Bug 20256: (QA follow-up) Fix missed change from item.cannot_be_edited to item.can_be_edited

Signed-off-by: Bob Bennhoff - CLiC <bbennhoff@clicweb.org>
Comment 162 Kyle M Hall 2020-08-21 18:20:40 UTC
Created attachment 108864 [details] [review]
Bug 20256: (QA follow-up) Redirect to record details page if user cannot edit this item

Signed-off-by: Bob Bennhoff - CLiC <bbennhoff@clicweb.org>
Comment 163 Kyle M Hall 2020-08-21 18:20:45 UTC
Created attachment 108865 [details] [review]
Bug 20256: (QA follow-up) Handle non-existing userenv

Signed-off-by: Bob Bennhoff - CLiC <bbennhoff@clicweb.org>
Comment 164 Kyle M Hall 2020-08-21 18:20:49 UTC
Created attachment 108866 [details] [review]
Bug 20256: (QA follow-up) Give existing users with edit_items permission edit_any_item as well

Signed-off-by: Bob Bennhoff - CLiC <bbennhoff@clicweb.org>
Comment 165 Kyle M Hall 2020-08-21 18:20:54 UTC
Created attachment 108867 [details] [review]
Bug 20256: (QA follow-up) Skip batch editing items the user is not allowed to edit

Signed-off-by: Bob Bennhoff - CLiC <bbennhoff@clicweb.org>
Comment 166 Kyle M Hall 2020-08-21 18:20:58 UTC
Created attachment 108868 [details] [review]
Bug 20256: (QA follow-up) Filter out branchcodes the user has no permissions for

Signed-off-by: Bob Bennhoff - CLiC <bbennhoff@clicweb.org>
Comment 167 Kyle M Hall 2020-08-21 18:21:03 UTC
Created attachment 108869 [details] [review]
Bug 20256: Mark ft_limit_item_editing as boolean in schema file

Signed-off-by: Bob Bennhoff - CLiC <bbennhoff@clicweb.org>
Comment 168 Kyle M Hall 2020-08-21 18:21:08 UTC
Created attachment 108870 [details] [review]
Bug 20256: Update DB Schema [DO NOT PUSH]

Signed-off-by: Bob Bennhoff - CLiC <bbennhoff@clicweb.org>
Comment 169 Katrin Fischer 2020-08-21 22:25:33 UTC
Hi Kyle,

first review here:

1) QA tools:

FAIL	cataloguing/additem.pl
   FAIL	  valid
		"my" variable $item masks earlier declaration in same scope 

2) Unit tests

Ran the database update, but tests are failing:

kohadev-koha@kohadevbox:/home/vagrant/kohaclone$ prove t/db_dependent/Koha/Patrons.t
t/db_dependent/Koha/Patrons.t .. 33/41 DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception: DBD::mysql::st execute failed: Duplicate entry 'OPLKEwkZw0DMeIN2d05GnFYtiGaCnqBtN4N03FSuWrNz' for key 'userid' [for Statement "UPDATE `borrowers` SET `userid` = ? WHERE ( `borrowernumber` = ? )" with ParamValues: 0='OPLKEwkZw0DMeIN2d05GnFYtiGaCnqBtN4N03FSuWrNz', 1='199'] at /home/vagrant/kohaclone/Koha/Object.pm line 166
t/db_dependent/Koha/Patrons.t .. 42/41 # Looks like you planned 41 tests but ran 42.
t/db_dependent/Koha/Patrons.t .. Dubious, test returned 255 (wstat 65280, 0xff00)
All 41 subtests passed 

Test Summary Report
-------------------
t/db_dependent/Koha/Patrons.t (Wstat: 65280 Tests: 42 Failed: 1)
  Failed test:  42
  Non-zero exit status: 255
  Parse errors: Bad plan.  You planned 41 tests but ran 42.

3) Methods

libraries_where_can_see_patrons is added to Patron.pm 
I am not sure how it fits into this functionality, maybe a leftover from an earlier development?

4) Item edit checks

I think we might also need a check on the permission from the item search edit item link.
Comment 170 Kyle M Hall 2020-09-11 13:12:03 UTC
Created attachment 109939 [details] [review]
Bug 20256: (QA follow-up) Fix variable masking warning in additem.pl
Comment 171 Kyle M Hall 2020-09-11 15:22:15 UTC
> 1) QA tools:
> 
> FAIL	cataloguing/additem.pl
>    FAIL	  valid
> 		"my" variable $item masks earlier declaration in same scope 

Fixed!

> 2) Unit tests
> 
> Ran the database update, but tests are failing:

I wasn't able to recreate your unit test failure. Can you try again?

> 3) Methods
> 
> libraries_where_can_see_patrons is added to Patron.pm 
> I am not sure how it fits into this functionality, maybe a leftover from an
> earlier development?

This subroutine is from Jonathan's patch that added group limits for viewing patrons. This patch set takes that logic and makes it more generic for use with other objects that also have branchcodes. libraries_where_can_see_patrons is the specific implementation for jonathans previous feature, which is now a wrapper around the more generic method that can also be used for items and other objects in the future.

 
> 4) Item edit checks
> 
> I think we might also need a check on the permission from the item search
> edit item link.

I've been working on this patch, but it occurs to me that the edit item link shows even if a record has no items. It's a useful way to go straight to the items editor to create a new item. As such, I don't think we should hide the link because it can still be used in that way even if the librarian can't edit any existing items.
Comment 172 Katrin Fischer 2020-09-12 09:52:07 UTC
> > 4) Item edit checks
> > 
> > I think we might also need a check on the permission from the item search
> > edit item link.
> 
> I've been working on this patch, but it occurs to me that the edit item link
> shows even if a record has no items. It's a useful way to go straight to the
> items editor to create a new item. As such, I don't think we should hide the
> link because it can still be used in that way even if the librarian can't
> edit any existing items.

Hi Kyle, I meant the "item search" - in this case the form for editing this specific item opens. So I think it makes sense to hide it there and I think there is already some logic for that now.
Comment 173 Katrin Fischer 2020-09-12 22:43:05 UTC
Created attachment 110005 [details] [review]
Bug 20256: (QA follow-up) Fix number of tests in Patrons.t
Comment 174 Katrin Fischer 2020-09-12 22:44:05 UTC
(In reply to Katrin Fischer from comment #172)
> > > 4) Item edit checks
> > > 
> > > I think we might also need a check on the permission from the item search
> > > edit item link.
> > 
> > I've been working on this patch, but it occurs to me that the edit item link
> > shows even if a record has no items. It's a useful way to go straight to the
> > items editor to create a new item. As such, I don't think we should hide the
> > link because it can still be used in that way even if the librarian can't
> > edit any existing items.
> 
> Hi Kyle, I meant the "item search" - in this case the form for editing this
> specific item opens. So I think it makes sense to hide it there and I think
> there is already some logic for that now.
I identified 3 places now that require action:

- Edit item link from course reserves
- Edit item link form item search (not catalog search)
- Edit item link from items tab (moredetail.pl)
Comment 175 Kyle M Hall 2020-11-17 12:27:30 UTC
Created attachment 113706 [details] [review]
Bug 20256: Update database

Test Plan:
1) Apply this patch set
2) Run updatedatabase.pl
3) Create two library groups with some libraries in them,
   make sure to enable the new feature to limit editing of items
4) Test the functionality, if an item is owned by a library in
   your group, you should have full editing abilities. If an item
   is from a different group, you should only be able to make the
   same changes you would be able to if IndependentBranches were.

Signed-off-by: Bob Bennhoff - CLiC <bbennhoff@clicweb.org>
Comment 176 Kyle M Hall 2020-11-17 12:27:47 UTC
Created attachment 113707 [details] [review]
Bug 20256: Add new permission to editor

Signed-off-by: Bob Bennhoff - CLiC <bbennhoff@clicweb.org>
Comment 177 Kyle M Hall 2020-11-17 12:27:54 UTC
Created attachment 113708 [details] [review]
Bug 20256: Refactor subs for rights to view patrons to make them generic for general use

Signed-off-by: Bob Bennhoff - CLiC <bbennhoff@clicweb.org>
Comment 178 Kyle M Hall 2020-11-17 12:28:00 UTC
Created attachment 113709 [details] [review]
Bug 20256: Add new methods for checking item editing permissions

Signed-off-by: Bob Bennhoff - CLiC <bbennhoff@clicweb.org>
Comment 179 Kyle M Hall 2020-11-17 12:28:06 UTC
Created attachment 113710 [details] [review]
Bug 20256: Update groups editor

Signed-off-by: Bob Bennhoff - CLiC <bbennhoff@clicweb.org>
Comment 180 Kyle M Hall 2020-11-17 12:28:13 UTC
Created attachment 113711 [details] [review]
Bug 20256: Use new methods

Signed-off-by: Bob Bennhoff - CLiC <bbennhoff@clicweb.org>
Comment 181 Kyle M Hall 2020-11-17 12:28:18 UTC
Created attachment 113712 [details] [review]
Bug 20256: Add unit tests

Signed-off-by: Bob Bennhoff - CLiC <bbennhoff@clicweb.org>
Comment 182 Kyle M Hall 2020-11-17 12:28:23 UTC
Created attachment 113713 [details] [review]
Bug 20256: (QA follow-up) Remove double negative from code

Signed-off-by: Bob Bennhoff - CLiC <bbennhoff@clicweb.org>
Comment 183 Kyle M Hall 2020-11-17 12:28:30 UTC
Created attachment 113714 [details] [review]
Bug 20256: (QA follow-up) Change meaning should change code

Signed-off-by: Bob Bennhoff - CLiC <bbennhoff@clicweb.org>
Comment 184 Kyle M Hall 2020-11-17 12:28:36 UTC
Created attachment 113715 [details] [review]
Bug 20256: (QA follow-up) test borrowernumber in userenv too

Bug 22600 added userenv for scripts, so userenv is defined, but some of
values in userenv not

Test plan:
Run with some params: misc/cronjobs/delete_items.pl

--> without this patch you will se error message:
    Can't call method "can_edit_item" on an undefined value at /home/vagrant/kohaclone/C4/Items.pm line 1748
--> with this patch everything works smoothly

Signed-off-by: Bob Bennhoff - CLiC <bbennhoff@clicweb.org>
Comment 185 Kyle M Hall 2020-11-17 12:28:42 UTC
Created attachment 113716 [details] [review]
Bug 20256: (QA follow-up) Fix column description for ft_limit_item_editing

Signed-off-by: Bob Bennhoff - CLiC <bbennhoff@clicweb.org>
Comment 186 Kyle M Hall 2020-11-17 12:28:48 UTC
Created attachment 113717 [details] [review]
Bug 20256: (QA follow-up) Fix missed change from item.cannot_be_edited to item.can_be_edited

Signed-off-by: Bob Bennhoff - CLiC <bbennhoff@clicweb.org>
Comment 187 Kyle M Hall 2020-11-17 12:28:55 UTC
Created attachment 113718 [details] [review]
Bug 20256: (QA follow-up) Redirect to record details page if user cannot edit this item

Signed-off-by: Bob Bennhoff - CLiC <bbennhoff@clicweb.org>
Comment 188 Kyle M Hall 2020-11-17 12:29:02 UTC
Created attachment 113719 [details] [review]
Bug 20256: (QA follow-up) Handle non-existing userenv

Signed-off-by: Bob Bennhoff - CLiC <bbennhoff@clicweb.org>
Comment 189 Kyle M Hall 2020-11-17 12:29:11 UTC
Created attachment 113720 [details] [review]
Bug 20256: (QA follow-up) Give existing users with edit_items permission edit_any_item as well

Signed-off-by: Bob Bennhoff - CLiC <bbennhoff@clicweb.org>
Comment 190 Kyle M Hall 2020-11-17 12:29:19 UTC
Created attachment 113721 [details] [review]
Bug 20256: (QA follow-up) Skip batch editing items the user is not allowed to edit

Signed-off-by: Bob Bennhoff - CLiC <bbennhoff@clicweb.org>
Comment 191 Kyle M Hall 2020-11-17 12:29:27 UTC
Created attachment 113722 [details] [review]
Bug 20256: (QA follow-up) Filter out branchcodes the user has no permissions for

Signed-off-by: Bob Bennhoff - CLiC <bbennhoff@clicweb.org>
Comment 192 Kyle M Hall 2020-11-17 12:29:33 UTC
Created attachment 113723 [details] [review]
Bug 20256: Mark ft_limit_item_editing as boolean in schema file

Signed-off-by: Bob Bennhoff - CLiC <bbennhoff@clicweb.org>
Comment 193 Kyle M Hall 2020-11-17 12:29:40 UTC
Created attachment 113724 [details] [review]
Bug 20256: Update DB Schema [DO NOT PUSH]

Signed-off-by: Bob Bennhoff - CLiC <bbennhoff@clicweb.org>
Comment 194 Kyle M Hall 2020-11-17 12:29:48 UTC
Created attachment 113725 [details] [review]
Bug 20256: (QA follow-up) Fix variable masking warning in additem.pl
Comment 195 Kyle M Hall 2020-11-17 12:29:54 UTC
Created attachment 113726 [details] [review]
Bug 20256: (QA follow-up) Fix number of tests in Patrons.t
Comment 196 Kyle M Hall 2020-11-17 12:30:01 UTC
Created attachment 113727 [details] [review]
Bug 20256: (QA follow-up) Implement for course reserves
Comment 197 Kyle M Hall 2020-11-17 12:30:08 UTC
Created attachment 113728 [details] [review]
Bug 20256: (QA follow-up) Implement for item search
Comment 198 Kyle M Hall 2020-11-17 13:52:52 UTC
(In reply to Katrin Fischer from comment #174)
> (In reply to Katrin Fischer from comment #172)
> > > > 4) Item edit checks
> > > > 
> > > > I think we might also need a check on the permission from the item search
> > > > edit item link.
> > > 
> > > I've been working on this patch, but it occurs to me that the edit item link
> > > shows even if a record has no items. It's a useful way to go straight to the
> > > items editor to create a new item. As such, I don't think we should hide the
> > > link because it can still be used in that way even if the librarian can't
> > > edit any existing items.
> > 
> > Hi Kyle, I meant the "item search" - in this case the form for editing this
> > specific item opens. So I think it makes sense to hide it there and I think
> > there is already some logic for that now.
> I identified 3 places now that require action:
> 
> - Edit item link from course reserves
> - Edit item link form item search (not catalog search)
> - Edit item link from items tab (moredetail.pl)

The edit item link on moredetail.pl was already implemented, is it not working for you?
Comment 199 Kyle M Hall 2021-01-29 15:31:52 UTC
Created attachment 116042 [details] [review]
Bug 20256: Update database

Test Plan:
1) Apply this patch set
2) Run updatedatabase.pl
3) Create two library groups with some libraries in them,
   make sure to enable the new feature to limit editing of items
4) Test the functionality, if an item is owned by a library in
   your group, you should have full editing abilities. If an item
   is from a different group, you should only be able to make the
   same changes you would be able to if IndependentBranches were.

Signed-off-by: Bob Bennhoff - CLiC <bbennhoff@clicweb.org>
Comment 200 Kyle M Hall 2021-01-29 15:32:43 UTC
Created attachment 116043 [details] [review]
Bug 20256: Update database

Test Plan:
1) Apply this patch set
2) Run updatedatabase.pl
3) Create two library groups with some libraries in them,
   make sure to enable the new feature to limit editing of items
4) Test the functionality, if an item is owned by a library in
   your group, you should have full editing abilities. If an item
   is from a different group, you should only be able to make the
   same changes you would be able to if IndependentBranches were.

Signed-off-by: Bob Bennhoff - CLiC <bbennhoff@clicweb.org>
Comment 201 Kyle M Hall 2021-01-29 15:32:55 UTC
Created attachment 116044 [details] [review]
Bug 20256: Add new permission to editor

Signed-off-by: Bob Bennhoff - CLiC <bbennhoff@clicweb.org>
Comment 202 Kyle M Hall 2021-01-29 15:33:01 UTC
Created attachment 116045 [details] [review]
Bug 20256: Refactor subs for rights to view patrons to make them generic for general use

Signed-off-by: Bob Bennhoff - CLiC <bbennhoff@clicweb.org>
Comment 203 Kyle M Hall 2021-01-29 15:33:06 UTC
Created attachment 116046 [details] [review]
Bug 20256: Add new methods for checking item editing permissions

Signed-off-by: Bob Bennhoff - CLiC <bbennhoff@clicweb.org>
Comment 204 Kyle M Hall 2021-01-29 15:33:10 UTC
Created attachment 116047 [details] [review]
Bug 20256: Update groups editor

Signed-off-by: Bob Bennhoff - CLiC <bbennhoff@clicweb.org>
Comment 205 Kyle M Hall 2021-01-29 15:33:16 UTC
Created attachment 116048 [details] [review]
Bug 20256: Use new methods

Signed-off-by: Bob Bennhoff - CLiC <bbennhoff@clicweb.org>
Comment 206 Kyle M Hall 2021-01-29 15:33:20 UTC
Created attachment 116049 [details] [review]
Bug 20256: Add unit tests

Signed-off-by: Bob Bennhoff - CLiC <bbennhoff@clicweb.org>
Comment 207 Kyle M Hall 2021-01-29 15:33:25 UTC
Created attachment 116050 [details] [review]
Bug 20256: (QA follow-up) Remove double negative from code

Signed-off-by: Bob Bennhoff - CLiC <bbennhoff@clicweb.org>
Comment 208 Kyle M Hall 2021-01-29 15:33:30 UTC
Created attachment 116051 [details] [review]
Bug 20256: (QA follow-up) Change meaning should change code

Signed-off-by: Bob Bennhoff - CLiC <bbennhoff@clicweb.org>
Comment 209 Kyle M Hall 2021-01-29 15:33:35 UTC
Created attachment 116052 [details] [review]
Bug 20256: (QA follow-up) test borrowernumber in userenv too

Bug 22600 added userenv for scripts, so userenv is defined, but some of
values in userenv not

Test plan:
Run with some params: misc/cronjobs/delete_items.pl

--> without this patch you will se error message:
    Can't call method "can_edit_item" on an undefined value at /home/vagrant/kohaclone/C4/Items.pm line 1748
--> with this patch everything works smoothly

Signed-off-by: Bob Bennhoff - CLiC <bbennhoff@clicweb.org>
Comment 210 Kyle M Hall 2021-01-29 15:33:40 UTC
Created attachment 116053 [details] [review]
Bug 20256: (QA follow-up) Fix missed change from item.cannot_be_edited to item.can_be_edited

Signed-off-by: Bob Bennhoff - CLiC <bbennhoff@clicweb.org>
Comment 211 Kyle M Hall 2021-01-29 15:33:44 UTC
Created attachment 116054 [details] [review]
Bug 20256: (QA follow-up) Redirect to record details page if user cannot edit this item

Signed-off-by: Bob Bennhoff - CLiC <bbennhoff@clicweb.org>
Comment 212 Kyle M Hall 2021-01-29 15:33:49 UTC
Created attachment 116055 [details] [review]
Bug 20256: (QA follow-up) Handle non-existing userenv

Signed-off-by: Bob Bennhoff - CLiC <bbennhoff@clicweb.org>
Comment 213 Kyle M Hall 2021-01-29 15:33:54 UTC
Created attachment 116056 [details] [review]
Bug 20256: (QA follow-up) Give existing users with edit_items permission edit_any_item as well

Signed-off-by: Bob Bennhoff - CLiC <bbennhoff@clicweb.org>
Comment 214 Kyle M Hall 2021-01-29 15:33:58 UTC
Created attachment 116057 [details] [review]
Bug 20256: (QA follow-up) Skip batch editing items the user is not allowed to edit

Signed-off-by: Bob Bennhoff - CLiC <bbennhoff@clicweb.org>
Comment 215 Kyle M Hall 2021-01-29 15:34:03 UTC
Created attachment 116058 [details] [review]
Bug 20256: (QA follow-up) Filter out branchcodes the user has no permissions for

Signed-off-by: Bob Bennhoff - CLiC <bbennhoff@clicweb.org>
Comment 216 Kyle M Hall 2021-01-29 15:34:09 UTC
Created attachment 116059 [details] [review]
Bug 20256: Mark ft_limit_item_editing as boolean in schema file

Signed-off-by: Bob Bennhoff - CLiC <bbennhoff@clicweb.org>
Comment 217 Kyle M Hall 2021-01-29 15:34:14 UTC
Created attachment 116060 [details] [review]
Bug 20256: (QA follow-up) Fix variable masking warning in additem.pl
Comment 218 Kyle M Hall 2021-01-29 15:34:18 UTC
Created attachment 116061 [details] [review]
Bug 20256: (QA follow-up) Fix number of tests in Patrons.t
Comment 219 Kyle M Hall 2021-01-29 15:34:23 UTC
Created attachment 116062 [details] [review]
Bug 20256: (QA follow-up) Implement for course reserves
Comment 220 Kyle M Hall 2021-01-29 15:34:28 UTC
Created attachment 116063 [details] [review]
Bug 20256: (QA follow-up) Implement for item search
Comment 221 Kyle M Hall 2021-01-29 15:34:32 UTC
Created attachment 116064 [details] [review]
Bug 20256: Update DB Schema [DO NOT PUSH]