Bug 32105 - Patron lists needs to share to specific people or groups
Summary: Patron lists needs to share to specific people or groups
Status: Failed QA
Alias: None
Product: Koha
Classification: Unclassified
Component: Tools (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low enhancement
Assignee: Michael Hafen
QA Contact: Testopia
URL:
Keywords:
Depends on: 32730
Blocks:
  Show dependency treegraph
 
Reported: 2022-11-04 00:08 UTC by Christopher Brannon
Modified: 2024-01-11 18:58 UTC (History)
3 users (show)

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


Attachments
Bug 32105 - Add Library and Individual sharing modes to Patron Lists (49.18 KB, patch)
2023-04-11 20:40 UTC, Michael Hafen
Details | Diff | Splinter Review
Bug 32105 - Add Library and Individual sharing modes to Patron Lists (52.75 KB, patch)
2024-01-09 00:35 UTC, Michael Hafen
Details | Diff | Splinter Review
Bug 32105 - Add Library and Individual sharing modes to Patron Lists (52.81 KB, patch)
2024-01-10 18:57 UTC, Michael Hafen
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Christopher Brannon 2022-11-04 00:08:07 UTC
If using patron lists with the batch permissions modifier plugin, there is no way to share that list with specific people or groups.  It is all or nothing.  This means if you use the plugin, either only one person maintains that list, or everyone with patron list permissions has access to that list, giving them power over all permissions.
Comment 1 Michael Hafen 2022-11-30 18:42:06 UTC
Sounds to me like you should file an enhancement request against the plugin, which comes from somewhere else, rather than here in Koha core.

Though I agree that it should be possible to share a list with a group; I don't like the all or nothing either.

My idea was to be able to share it with other staff at a certain branch, which should be a relatively easy enhancement.
Comment 2 Katrin Fischer 2022-12-04 12:57:14 UTC
I also think that the plugin doesn't make a strong enough use case here as it's basically a work around for a feature we are missing.

But: I think having the option to add 'users' to a list like we can for example to for acq orders would make a nice addition.
Comment 3 Michael Hafen 2023-04-11 20:40:08 UTC
Created attachment 149475 [details] [review]
Bug 32105 - Add Library and Individual sharing modes to  Patron Lists

Test Plan:
1. apply patch, restart Plack, etc.
2. create or select three users, two at the same library and one not.
3. create or select a patron list owned by one of the users at the same library.
4. edit list and change sharing mode to 'Library and individuals'.
5. login as the other user at the same library and navigate to patron lists.
6. observe that the list is shared.
7. login as the third user and navigate to patron lists.
8. observe that the list is not shared with this user.
9. login as the owner of the list.
10. edit the list and add the third user as an individual.
11. login as the third user and navigate to patron lists.
12. observe that the list is now shared with the third user.
13. login as the owner of the list.
14. edit the list to change the sharing mode to 'Individuals'.
15. login as the second and third users.
16. observe that the list is not shared with the second user, but still is
      with the third user.
Comment 4 Matthias Le Gac 2024-01-08 18:53:36 UTC
Patch doesn't apply.

I have this error : 
Applying: Bug 32105 - Add Library and Individual sharing modes to Patron Lists
error: sha1 information is lacking or useless (patron_lists/patron-lists-tab.pl).
error: could not build fake ancestor
Patch failed at 0001 Bug 32105 - Add Library and Individual sharing modes to Patron Lists
hint: Use 'git am --show-current-patch=diff' to see the failed 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-32105---Add-Library-and-Individual-sharing-mod-6hyf27nh.patch
Comment 5 Michael Hafen 2024-01-09 00:35:14 UTC
Created attachment 160679 [details] [review]
Bug 32105 - Add Library and Individual sharing modes to  Patron Lists

[Rebase on master 2023-12-28]

Test Plan:
1. apply patch, restart Plack, etc.
2. create or select three users, two at the same library and one not.
3. create or select a patron list owned by one of the users at the same library.
4. edit list and change sharing mode to 'Library and individuals'.
5. login as the other user at the same library and navigate to patron lists.
6. observe that the list is shared.
7. login as the third user and navigate to patron lists.
8. observe that the list is not shared with this user.
9. login as the owner of the list.
10. edit the list and add the third user as an individual.
11. login as the third user and navigate to patron lists.
12. observe that the list is now shared with the third user.
13. login as the owner of the list.
14. edit the list to change the sharing mode to 'Individuals'.
15. login as the second and third users.
16. observe that the list is not shared with the second user, but still is
      with the third user.
Comment 6 Matthias Le Gac 2024-01-09 13:54:30 UTC
I can apply the patch but when I click on the button "New patron list" I have an 500 error.

I have update my DB and I have the new table "patron_lis_user" and the new shares modes. 

I missed something ?
Comment 7 Matthias Le Gac 2024-01-09 14:38:53 UTC
My bad I found the problem
Comment 8 Matthias Le Gac 2024-01-09 16:09:22 UTC
(In reply to Matthias Le Gac from comment #7)
>
Comment 9 Matthias Le Gac 2024-01-09 16:10:52 UTC
(In reply to Matthias Le Gac from comment #7)
> My bad I found the problem

I always have the error 500 but Ithink it's a problem with my configuration of Koha. I check for signoff when i fix my problem.
Comment 10 Matthias Le Gac 2024-01-09 16:57:40 UTC
My configuration of Koha is good now and I always have the 500 error. 

The log is : 
[Tue Jan 09 11:47:39.080444 2024] [core:notice] [pid 6891] AH00094: Command line: '/usr/sbin/apache2'
Template process failed: file error - patron_search_filters_simple: not found at /inlibro/git/koha-master-dev-matthias/C4/Templates.pm line 134.
Template process failed: file error - patron_search_filters_simple: not found at /inlibro/git/koha-master-dev-matthias/C4/Templates.pm line 134.

I have the 500 error when I want to create a new "Patron list" and when I don't have the patch I can create a new "Patron list".
Comment 11 Michael Hafen 2024-01-10 18:57:50 UTC
Created attachment 160783 [details] [review]
Bug 32105 - Add Library and Individual sharing modes to  Patron Lists

[ rebase on 2023-12-28  with fix for add-modify.tt ]

Test Plan:
1. apply patch, restart Plack, etc.
2. create or select three users, two at the same library and one not.
3. create or select a patron list owned by one of the users at the same library.
4. edit list and change sharing mode to 'Library and individuals'.
5. login as the other user at the same library and navigate to patron lists.
6. observe that the list is shared.
7. login as the third user and navigate to patron lists.
8. observe that the list is not shared with this user.
9. login as the owner of the list.
10. edit the list and add the third user as an individual.
11. login as the third user and navigate to patron lists.
12. observe that the list is now shared with the third user.
13. login as the owner of the list.
14. edit the list to change the sharing mode to 'Individuals'.
15. login as the second and third users.
16. observet that the list is not shared with the second user, but still is
      with the third user.
Comment 12 Matthias Le Gac 2024-01-10 19:28:33 UTC
The patron list is share with the user who isn't in the same library while the sharing mode is Library staff and individuals. 
And the user who isn't in the same library isn't add in the individuals list.