Description
Nick Clemens (kidclamp)
2022-03-31 13:18:18 UTC
Hi Nick, I have read it several times, but I am not sure I understand yet what the new permissions would look like. Maybe you could write them up? +1 Really interested in this development. Created attachment 139696 [details] [review] Bug 30418: Database changes Sponsored-by: Catalyst IT, New Zealand Created attachment 139697 [details] [review] Bug 30418: Updated schema file Sponsored-by: Catalyst IT, New Zealand Created attachment 139698 [details] [review] Bug 30418: Template and JavaScript changes Sponsored-by: Catalyst IT, New Zealand Created attachment 139699 [details] [review] Bug 30418: Add ability for permitted staff to edit list contents Public lists with 'Allow changes to contents from' = 'Permitted staff only' can have their contents managed by Koha patrons with either of the permissions below: - superlibrarian permission - catalogue permission + 'edit_public_list_contents' sub-permission Test plan: 1. Apply patches, update database, restart services 2. In the staff client go to: Lists > New List 3. Create a list, choose 'Allow changes to contents from' => 'Permitted staff only' 4. Log into the OPAC as a patron with no permissions. 5. Confirm you CANNOT add a biblio to the list from the OPAC search result page and OPAC biblio detail pages 6. Log into the OPAC as a patron with only the 'catalogue' permissions enabled 7. Confirm you CANNOT add a biblio to the list from OPAC search result or biblio detail pages 8. Log into the OPAC as a patron with the 'catalogue' and 'edit_public_list_contents' permissions enabled 9. Confirm you CAN add/remove biblios from the OPAC search result and biblio detail pages 10. Log into the OPAC as a patron with superlibrarian permissions 11. Confirm you CAN add a biblio to the list from the OPAC search result page and OPAC biblio detail pages 12. Log into the staff client as a patron with only the 'catalogue' permission and confirm you CANNOT add/remove records from the list 13. Log into the staff client as a patron with the 'catalogue' and 'edit_public_list_contents' sub-permission (found under 'Lists' parent permission) 14. Confirm you CAN add/remove records from the list 15. Login into thestaff client as a patron with 'superlibrarian' permissions and confirm you CAN add/remove records from the list Sponsored-by: Catalyst IT, New Zealand Created attachment 139700 [details] [review] Bug 30418: Unit tests Test plan: 1. Run unit tests sudo koha-shell <instance> prove t/db_dependent/Koha/Patron.t prove t/db_dependent/Virtualshelves.t Sponsored-by: Catalyst IT, New Zealand Created attachment 139701 [details] [review] Bug 30418: Re-order options of who can edit list contents The 'Allow changes to contents from' dropdown when creating/edit lists should be most locked down to least locked down: 1. Nobody 2. Owner only 3. Permitted staff only 4. Staff only 5. Anyone seeing this list Sponsored-by: Catalyst IT, New Zealand This is now ready to test. I have named the new 'Allow changes to contents from' dropdown option 'Permitted staff only'. I'm happy to change this naming to 'Staff with permissions' or other variations if you think it might clarify what it does. CONFLICT (content): Merge conflict in koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt Auto-merging koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc error: Failed to merge in the changes.Patch failed at 0001 Bug 30418: Template and JavaScript changes Created attachment 146363 [details] [review] Bug 30418: Database changes Sponsored-by: Catalyst IT, New Zealand Created attachment 146364 [details] [review] Bug 30418: Updated schema file Sponsored-by: Catalyst IT, New Zealand Created attachment 146365 [details] [review] Bug 30418: Template and JavaScript changes Sponsored-by: Catalyst IT, New Zealand Created attachment 146366 [details] [review] Bug 30418: Add ability for permitted staff to edit list contents Public lists with 'Allow changes to contents from' = 'Permitted staff only' can have their contents managed by Koha patrons with either of the permissions below: - superlibrarian permission - catalogue permission + 'edit_public_list_contents' sub-permission Test plan: 1. Apply patches, update database, restart services 2. In the staff client go to: Lists > New List 3. Create a list, choose 'Allow changes to contents from' => 'Permitted staff only' 4. Log into the OPAC as a patron with no permissions. 5. Confirm you CANNOT add a biblio to the list from the OPAC search result page and OPAC biblio detail pages 6. Log into the OPAC as a patron with only the 'catalogue' permissions enabled 7. Confirm you CANNOT add a biblio to the list from OPAC search result or biblio detail pages 8. Log into the OPAC as a patron with the 'catalogue' and 'edit_public_list_contents' permissions enabled 9. Confirm you CAN add/remove biblios from the OPAC search result and biblio detail pages 10. Log into the OPAC as a patron with superlibrarian permissions 11. Confirm you CAN add a biblio to the list from the OPAC search result page and OPAC biblio detail pages 12. Log into the staff client as a patron with only the 'catalogue' permission and confirm you CANNOT add/remove records from the list 13. Log into the staff client as a patron with the 'catalogue' and 'edit_public_list_contents' sub-permission (found under 'Lists' parent permission) 14. Confirm you CAN add/remove records from the list 15. Login into thestaff client as a patron with 'superlibrarian' permissions and confirm you CAN add/remove records from the list Sponsored-by: Catalyst IT, New Zealand Created attachment 146367 [details] [review] Bug 30418: Unit tests Test plan: 1. Run unit tests sudo koha-shell <instance> prove t/db_dependent/Koha/Patron.t prove t/db_dependent/Virtualshelves.t Sponsored-by: Catalyst IT, New Zealand Created attachment 146368 [details] [review] Bug 30418: Re-order options of who can edit list contents The 'Allow changes to contents from' dropdown when creating/edit lists should be most locked down to least locked down: 1. Nobody 2. Owner only 3. Permitted staff only 4. Staff only 5. Anyone seeing this list Sponsored-by: Catalyst IT, New Zealand Rebased against master. Ready for testing again Works as describe and tests pass Created attachment 146374 [details] [review] Bug 30418: Database changes Sponsored-by: Catalyst IT, New Zealand Created attachment 146375 [details] [review] Bug 30418: Updated schema file Sponsored-by: Catalyst IT, New Zealand Created attachment 146376 [details] [review] Bug 30418: Template and JavaScript changes Sponsored-by: Catalyst IT, New Zealand Created attachment 146377 [details] [review] Bug 30418: Add ability for permitted staff to edit list contents Public lists with 'Allow changes to contents from' = 'Permitted staff only' can have their contents managed by Koha patrons with either of the permissions below: - superlibrarian permission - catalogue permission + 'edit_public_list_contents' sub-permission Test plan: 1. Apply patches, update database, restart services 2. In the staff client go to: Lists > New List 3. Create a list, choose 'Allow changes to contents from' => 'Permitted staff only' 4. Log into the OPAC as a patron with no permissions. 5. Confirm you CANNOT add a biblio to the list from the OPAC search result page and OPAC biblio detail pages 6. Log into the OPAC as a patron with only the 'catalogue' permissions enabled 7. Confirm you CANNOT add a biblio to the list from OPAC search result or biblio detail pages 8. Log into the OPAC as a patron with the 'catalogue' and 'edit_public_list_contents' permissions enabled 9. Confirm you CAN add/remove biblios from the OPAC search result and biblio detail pages 10. Log into the OPAC as a patron with superlibrarian permissions 11. Confirm you CAN add a biblio to the list from the OPAC search result page and OPAC biblio detail pages 12. Log into the staff client as a patron with only the 'catalogue' permission and confirm you CANNOT add/remove records from the list 13. Log into the staff client as a patron with the 'catalogue' and 'edit_public_list_contents' sub-permission (found under 'Lists' parent permission) 14. Confirm you CAN add/remove records from the list 15. Login into thestaff client as a patron with 'superlibrarian' permissions and confirm you CAN add/remove records from the list Sponsored-by: Catalyst IT, New Zealand Created attachment 146378 [details] [review] Bug 30418: Unit tests Test plan: 1. Run unit tests sudo koha-shell <instance> prove t/db_dependent/Koha/Patron.t prove t/db_dependent/Virtualshelves.t Sponsored-by: Catalyst IT, New Zealand Created attachment 146379 [details] [review] Bug 30418: Re-order options of who can edit list contents The 'Allow changes to contents from' dropdown when creating/edit lists should be most locked down to least locked down: 1. Nobody 2. Owner only 3. Permitted staff only 4. Staff only 5. Anyone seeing this list Sponsored-by: Catalyst IT, New Zealand Created attachment 146609 [details] [review] Bug 30418: (follow-up) Fixes for QA test tools Sponsored-by: Catalyst IT, New Zealand Created attachment 148645 [details] [review] Bug 30418: Database changes Sponsored-by: Catalyst IT, New Zealand Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Created attachment 148646 [details] [review] Bug 30418: Updated schema file Sponsored-by: Catalyst IT, New Zealand Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Created attachment 148647 [details] [review] Bug 30418: Template and JavaScript changes Sponsored-by: Catalyst IT, New Zealand Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Created attachment 148648 [details] [review] Bug 30418: Add ability for permitted staff to edit list contents Public lists with 'Allow changes to contents from' = 'Permitted staff only' can have their contents managed by Koha patrons with either of the permissions below: - superlibrarian permission - catalogue permission + 'edit_public_list_contents' sub-permission Test plan: 1. Apply patches, update database, restart services 2. In the staff client go to: Lists > New List 3. Create a list, choose 'Allow changes to contents from' => 'Permitted staff only' 4. Log into the OPAC as a patron with no permissions. 5. Confirm you CANNOT add a biblio to the list from the OPAC search result page and OPAC biblio detail pages 6. Log into the OPAC as a patron with only the 'catalogue' permissions enabled 7. Confirm you CANNOT add a biblio to the list from OPAC search result or biblio detail pages 8. Log into the OPAC as a patron with the 'catalogue' and 'edit_public_list_contents' permissions enabled 9. Confirm you CAN add/remove biblios from the OPAC search result and biblio detail pages 10. Log into the OPAC as a patron with superlibrarian permissions 11. Confirm you CAN add a biblio to the list from the OPAC search result page and OPAC biblio detail pages 12. Log into the staff client as a patron with only the 'catalogue' permission and confirm you CANNOT add/remove records from the list 13. Log into the staff client as a patron with the 'catalogue' and 'edit_public_list_contents' sub-permission (found under 'Lists' parent permission) 14. Confirm you CAN add/remove records from the list 15. Login into thestaff client as a patron with 'superlibrarian' permissions and confirm you CAN add/remove records from the list Sponsored-by: Catalyst IT, New Zealand Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Created attachment 148649 [details] [review] Bug 30418: Unit tests Test plan: 1. Run unit tests sudo koha-shell <instance> prove t/db_dependent/Koha/Patron.t prove t/db_dependent/Virtualshelves.t Sponsored-by: Catalyst IT, New Zealand Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Created attachment 148650 [details] [review] Bug 30418: Re-order options of who can edit list contents The 'Allow changes to contents from' dropdown when creating/edit lists should be most locked down to least locked down: 1. Nobody 2. Owner only 3. Permitted staff only 4. Staff only 5. Anyone seeing this list Sponsored-by: Catalyst IT, New Zealand Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Created attachment 148651 [details] [review] Bug 30418: (follow-up) Fixes for QA test tools Sponsored-by: Catalyst IT, New Zealand Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Created attachment 148652 [details] [review] Bug 30418: (QA follow-up): Fix unit test count Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Pushed to master for 23.05. Nice work everyone, thanks! Created attachment 151249 [details] [review] Bug 30418: Fix t/Koha/Auth/Permissions.t koha_1 | # Failed test 'Expected permissions generated for superlibrarian' koha_1 | # at t/Koha/Auth/Permissions.t line 283. koha_1 | # Structures begin differing at: koha_1 | # $got->{CAN_user_lists_edit_public_list_contents} = '1' koha_1 | # $expected->{CAN_user_lists_edit_public_list_contents} = Does not exist koha_1 | # Looks like you failed 1 test of 1. koha_1 | koha_1 | # Failed test 'superlibrarian tests' koha_1 | # at t/Koha/Auth/Permissions.t line 284. koha_1 | # Looks like you failed 1 test of 3. koha_1 | [23:34:42] t/Koha/Auth/Permissions.t (In reply to Jonathan Druart from comment #35) > Created attachment 151249 [details] [review] [review] > Bug 30418: Fix t/Koha/Auth/Permissions.t > > koha_1 | # Failed test 'Expected permissions generated for > superlibrarian' > koha_1 | # at t/Koha/Auth/Permissions.t line 283. > koha_1 | # Structures begin differing at: > koha_1 | # > $got->{CAN_user_lists_edit_public_list_contents} = '1' > koha_1 | # > $expected->{CAN_user_lists_edit_public_list_contents} = Does not exist > koha_1 | # Looks like you failed 1 test of 1. > koha_1 | > koha_1 | # Failed test 'superlibrarian tests' > koha_1 | # at t/Koha/Auth/Permissions.t line 284. > koha_1 | # Looks like you failed 1 test of 3. > koha_1 | [23:34:42] t/Koha/Auth/Permissions.t Pushed to master. Hmm We have problems with permissions now. Could this one be the cause? (In reply to Marcel de Rooy from comment #37) > Hmm We have problems with permissions now. Could this one be the cause? Still looking btw Hi Marcel, According to comment #36 this enhancement (bug 30418) was pushed to master around 2023-05-16 09:28:06 UTC, however, the list permission problems in bug 33722 were reported earlier at 2023-05-11 23:16:42 UTC Also, noting that if you checkout 2928c1cf634c97041ea3b1268dcc27a550feb2ca 'Bug 32775: (QA follow-up) remove useless empty line' (the commit in log before bug 30418 was pushed) the problem reported in bug 33722 can be replicated then. Alex (In reply to Alex Buckley from comment #39) > Hi Marcel, > > According to comment #36 this enhancement (bug 30418) was pushed to master > around 2023-05-16 09:28:06 UTC, however, the list permission problems in bug > 33722 were reported earlier at 2023-05-11 23:16:42 UTC > > Also, noting that if you checkout 2928c1cf634c97041ea3b1268dcc27a550feb2ca > 'Bug 32775: (QA follow-up) remove useless empty line' (the commit in log > before bug 30418 was pushed) the problem reported in bug 33722 can be > replicated then. > > Alex Might be false alarm indeed. Sorry for the confusion. (In reply to Marcel de Rooy from comment #40) > (In reply to Alex Buckley from comment #39) > > Hi Marcel, > > > > According to comment #36 this enhancement (bug 30418) was pushed to master > > around 2023-05-16 09:28:06 UTC, however, the list permission problems in bug > > 33722 were reported earlier at 2023-05-11 23:16:42 UTC > > > > Also, noting that if you checkout 2928c1cf634c97041ea3b1268dcc27a550feb2ca > > 'Bug 32775: (QA follow-up) remove useless empty line' (the commit in log > > before bug 30418 was pushed) the problem reported in bug 33722 can be > > replicated then. > > > > Alex > > Might be false alarm indeed. Sorry for the confusion. No worries, thanks Marcel Enhancement - not backporting to 22.11.x |