Bug 22529 - /svc/members/search relies on quirks of haspermission
Summary: /svc/members/search relies on quirks of haspermission
Status: Pushed to master
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Jonathan Druart
QA Contact: Testopia
URL:
Keywords:
Depends on: 22483
Blocks:
  Show dependency treegraph
 
Reported: 2019-03-18 10:05 UTC by Martin Renvoize
Modified: 2020-04-01 21:18 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Who signed the patch off:
Text to go in the release notes:
Version(s) released in:
20.05.00


Attachments
Bug 22529: Use new C4::Auth::haspermission from svc/members/search (1.84 KB, patch)
2019-05-06 16:05 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 22529: Use new C4::Auth::haspermission from svc/members/search (1.93 KB, patch)
2020-03-03 16:04 UTC, Bernardo Gonzalez Kriegel
Details | Diff | Splinter Review
Bug 22529: Use new C4::Auth::haspermission from svc/members/search (1.99 KB, patch)
2020-03-04 11:18 UTC, Martin Renvoize
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Renvoize 2019-03-18 10:05:19 UTC
Just parking this one here so we don't lose the comment from a closed bug 22483

>(In reply to Martin Renvoize from comment #0)
>> This functionality was in use in two places. /svc/members/search and
>> /Koha/REST/V1/Auth.pm.
>
>
>About /svc/members/search: at first glance I think we should rewrite this code to adapt it, not the other way around.
Comment 1 Jonathan Druart 2019-05-06 16:05:46 UTC
Created attachment 89372 [details] [review]
Bug 22529: Use new C4::Auth::haspermission from svc/members/search

The svc/members/search script can be used to retrieve patrons with a
specific permission. This feature is only used once, to link patrons to
funds.
The code in the script is duplicated from what we have in
C4::Auth::haspermission, and it makes sense to clean it.

Test plan:
Create a fund and add users to this fund.
When you search for users you must only have a list of patrons with the
acquisition.order_manage permission.
Comment 2 Bernardo Gonzalez Kriegel 2020-03-03 16:04:13 UTC
Created attachment 100042 [details] [review]
Bug 22529: Use new C4::Auth::haspermission from svc/members/search

The svc/members/search script can be used to retrieve patrons with a
specific permission. This feature is only used once, to link patrons to
funds.
The code in the script is duplicated from what we have in
C4::Auth::haspermission, and it makes sense to clean it.

Test plan:
Create a fund and add users to this fund.
When you search for users you must only have a list of patrons with the
acquisition.order_manage permission.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Works as described. No errors
Comment 3 Martin Renvoize 2020-03-04 11:18:33 UTC
Created attachment 100096 [details] [review]
Bug 22529: Use new C4::Auth::haspermission from svc/members/search

The svc/members/search script can be used to retrieve patrons with a
specific permission. This feature is only used once, to link patrons to
funds.
The code in the script is duplicated from what we have in
C4::Auth::haspermission, and it makes sense to clean it.

Test plan:
Create a fund and add users to this fund.
When you search for users you must only have a list of patrons with the
acquisition.order_manage permission.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Works as described. No errors
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 4 Martin Renvoize 2020-03-04 11:19:32 UTC
Took me a short while to wrap my head back around this one.. sorry it's languished so long..

I'm confident in the change, thanks for taking it on Jonathan.

PQA
Comment 5 Martin Renvoize 2020-03-04 16:13:33 UTC
Nice work everyone!

Pushed to master for 20.05
Comment 6 Joy Nelson 2020-04-01 21:18:11 UTC
enhancement not backported to 19.11.x