Bug 38128

Summary: Agreement/license user selection not limited to users with ERM module permissions
Product: Koha Reporter: Caroline Cyr La Rose <caroline.cyr-la-rose>
Component: ERMAssignee: Jonathan Druart <jonathan.druart>
Status: Pushed to stable --- QA Contact: Martin Renvoize (ashimema) <martin.renvoize>
Severity: normal    
Priority: P5 - low CC: caroline.cyr-la-rose, jonathan.druart, jonathan.field, lucas, martin.renvoize, matt.blenkinsop, pedro.amorim
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
24.11.00,24.05.06
Circulation function:
Bug Depends on: 35329    
Bug Blocks:    
Attachments: Bug 38128: (Bug 35329 follow-up) Filter ERM users to users with erm permission
Bug 38128: (Bug 35329 follow-up) Filter ERM users to users with erm permission
Bug 38128: (Bug 35329 follow-up) Filter ERM users to users with erm permission
Bug 38128: Fix cypress test

Description Caroline Cyr La Rose 2024-10-08 19:01:18 UTC
The manual says that the user selection in ERM agreements and licences are limited to patrons with erm permissions. This is no longer true. I don't know if it is intentional, or a simple omission (possibly from Bug 35329). It made sense to limit the patron search this way, I think.

To get there:
1. Enable ERMModule
2. Go to E-resource management > Agreement > New agreement
3. Click 'Add new user'
4. Click 'Select user'
5. Search for alford (for example)
   --> Jordan Alford is in the results, even if they don't have erm permissions
6. Go to Licences > New licence
7. Repeat steps 3-5
   --> Jordan Alford is in the results, even if they don't have erm permissions

I tried on a local 23.05 installation and Jordan Alford is not in the results, because they don't have erm permissions.
Comment 1 Jonathan Druart 2024-10-09 07:33:18 UTC
Created attachment 172556 [details] [review]
Bug 38128: (Bug 35329 follow-up) Filter ERM users to users with erm permission

There was a silly mistake, we passed the TT var erm_users instead of the
string "erm_users".
It should also be passed to patron_search_modal to display the note.

Test plan:
Confirm that with this patch a patron search in the ERM module returns
only patrons with the erm permission.
Comment 2 Pedro Amorim 2024-10-09 08:00:24 UTC
Created attachment 172558 [details] [review]
Bug 38128: (Bug 35329 follow-up) Filter ERM users to users with erm permission

There was a silly mistake, we passed the TT var erm_users instead of the
string "erm_users".
It should also be passed to patron_search_modal to display the note.

Test plan:
Confirm that with this patch a patron search in the ERM module returns
only patrons with the erm permission.

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Comment 3 Pedro Amorim 2024-10-22 11:55:22 UTC
@Caroline are you able to test this, as the original reporter of the bug? If you're able to add your SO, we can change mine to PQA to help this move in the queue.
Comment 4 Martin Renvoize (ashimema) 2024-10-28 11:02:08 UTC
Created attachment 173510 [details] [review]
Bug 38128: (Bug 35329 follow-up) Filter ERM users to users with erm permission

There was a silly mistake, we passed the TT var erm_users instead of the
string "erm_users".
It should also be passed to patron_search_modal to display the note.

Test plan:
Confirm that with this patch a patron search in the ERM module returns
only patrons with the erm permission.

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 5 Katrin Fischer 2024-10-29 07:54:31 UTC
Pushed for 24.11!

Well done everyone, thank you!
Comment 6 Jonathan Druart 2024-11-07 10:59:24 UTC
Created attachment 174111 [details] [review]
Bug 38128: Fix cypress test

We were mocking the wrong route.
Comment 7 Katrin Fischer 2024-11-07 11:04:19 UTC
(In reply to Jonathan Druart from comment #6)
> Created attachment 174111 [details] [review] [review]
> Bug 38128: Fix cypress test
> 
> We were mocking the wrong route.

Thanks, picked follow-up for main.
Comment 8 Lucas Gass (lukeg) 2024-11-22 21:25:15 UTC
Backported to 24.05.x for upcoming 24.05.06