[Bug 38291] New: Add GET /library_groups
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38291 Bug ID: 38291 Summary: Add GET /library_groups Change sponsored?: --- Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: REST API Assignee: koha-bugs@lists.koha-community.org Reporter: matt.blenkinsop@ptfs-europe.com QA Contact: testopia@bugs.koha-community.org CC: tomascohen@gmail.com We should have an endpoint to list library groups -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38291 Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |38290 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38290 [Bug 38290] Add library group limits to vendors -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38291 --- Comment #1 from Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> --- Created attachment 175162 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=175162&action=edit Bug 38291: Add an endpoint to list library groups (cherry picked from commit cd2440165f62e96410df9d11bb3aab578d028016) -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38291 --- Comment #2 from Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> --- Created attachment 175163 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=175163&action=edit Bug 38291: Add a unit test (cherry picked from commit 9f9c2a0678c42ec5ac4016dd2ef603232150e770) -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38291 Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38291 Lisette Scheer <lisette@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lisette@bywatersolutions.co | |m --- Comment #3 from Lisette Scheer <lisette@bywatersolutions.com> --- Do you have a test plan? -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38291 Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |matt.blenkinsop@openfifth.c |ity.org |o.uk CC| |caroline.cyr-la-rose@inlibr | |o.com -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38291 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dcook@prosentient.com.au -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38291 Brendan Gallagher <brendan@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38291 Brendan Gallagher <brendan@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #175162|0 |1 is obsolete| | --- Comment #4 from Brendan Gallagher <brendan@bywatersolutions.com> --- Created attachment 180484 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=180484&action=edit Bug 38291: Add an endpoint to list library groups (cherry picked from commit cd2440165f62e96410df9d11bb3aab578d028016) Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38291 Brendan Gallagher <brendan@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #175163|0 |1 is obsolete| | --- Comment #5 from Brendan Gallagher <brendan@bywatersolutions.com> --- Created attachment 180485 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=180485&action=edit Bug 38291: Add a unit test (cherry picked from commit 9f9c2a0678c42ec5ac4016dd2ef603232150e770) Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38291 Brendan Gallagher <brendan@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |brendan@bywatersolutions.co | |m --- Comment #6 from Brendan Gallagher <brendan@bywatersolutions.com> --- Code looks good enough to move to QA for review (there are a few QA followups but those are trivial - so moving this forward) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38291 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lucas@bywatersolutions.com Status|Signed Off |Failed QA --- Comment #7 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- A couple of problems the QA tool spotted with api/v1/library_groups.t -Permission seems wrong: FAIL file_permissions File must have the exec flag -It may not be tidy: FAIL tidiness File is not tidy, please run `perl misc/devel/tidy.pl t/db_dependent/api/v1/library_groups.t` A test is failing after running yarn build: Running tests (1) * Proving /kohadevbox/koha/t/db_dependent/api/v1/library_groups.t FAIL # Failed test 'SWAGGER3.2.2' # at /kohadevbox/koha/t/db_dependent/api/v1/library_groups.t line 72. # got: '500' # expected: '200' # Looks like you planned 3 tests but ran 2. # Looks like you failed 1 test of 2 run. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38291 --- Comment #8 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- *** Bug 34420 has been marked as a duplicate of this bug. *** -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38291 Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38291 Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #180484|0 |1 is obsolete| | --- Comment #9 from Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> --- Created attachment 188411 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=188411&action=edit Bug 38291: Add an endpoint to list library groups (cherry picked from commit cd2440165f62e96410df9d11bb3aab578d028016) Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38291 Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #180485|0 |1 is obsolete| | --- Comment #10 from Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> --- Created attachment 188412 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=188412&action=edit Bug 38291: Add a unit test (cherry picked from commit 9f9c2a0678c42ec5ac4016dd2ef603232150e770) Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38291 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |lucas@bywatersolutions.com |y.org | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38291 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Small patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38291 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Failed QA --- Comment #11 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- I think xt/api.t needs updated here: xt/api.t ........................................ 3/8 # Failed test 'No tag errors in the spec' # at xt/api.t line 130. # Structures begin differing at: # $got->[0] = 'get /library_groups -> uses tag 'library_groups' not present in top level list' # $expected->[0] = Does not exist get /library_groups -> uses tag 'library_groups' not present in top level list # Looks like you failed 1 test of 1. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38291 Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38291 --- Comment #12 from Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> --- Created attachment 193255 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=193255&action=edit Bug 38291: (QA follow-up) Add library_groups tag to swagger.yaml -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38291 Lisette Scheer <lisette@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Patch doesn't apply -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38291 Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Patch doesn't apply |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38291 Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #188411|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38291 Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #188412|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38291 Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #193255|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38291 --- Comment #13 from Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> --- Created attachment 202343 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=202343&action=edit Bug 38291: Add an endpoint to list library groups (cherry picked from commit cd2440165f62e96410df9d11bb3aab578d028016) Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38291 --- Comment #14 from Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> --- Created attachment 202344 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=202344&action=edit Bug 38291: Add a unit test (cherry picked from commit 9f9c2a0678c42ec5ac4016dd2ef603232150e770) Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38291 --- Comment #15 from Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> --- Created attachment 202345 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=202345&action=edit Bug 38291: (QA follow-up) Add library_groups tag to swagger.yaml Patch from commit b33959a -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38291 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Failed QA --- Comment #16 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- In the spec you have: type: object properties: id: type: string description: internally assigned library group identifier maxLength: 10 minLength: 1 But the database says library_groups.id is int(11), should we update that to match? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38291 Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38291 --- Comment #17 from Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> --- Created attachment 203450 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=203450&action=edit Bug 38291: (QA follow-up) Update id swagger definition to match db Patch from commit 6cb95ca -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38291 Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #203450|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38291 --- Comment #18 from Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> --- Created attachment 203451 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=203451&action=edit Bug 38291: (QA follow-up) Update id swagger definition to match db Patch from commit a2bbf40 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38291 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38291 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #202343|0 |1 is obsolete| | Attachment #202344|0 |1 is obsolete| | Attachment #202345|0 |1 is obsolete| | Attachment #203451|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38291 --- Comment #19 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Created attachment 204384 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=204384&action=edit Bug 38291: Add an endpoint to list library groups (cherry picked from commit cd2440165f62e96410df9d11bb3aab578d028016) Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com> Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38291 --- Comment #20 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Created attachment 204385 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=204385&action=edit Bug 38291: Add a unit test (cherry picked from commit 9f9c2a0678c42ec5ac4016dd2ef603232150e770) Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com> Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38291 --- Comment #21 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Created attachment 204386 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=204386&action=edit Bug 38291: (QA follow-up) Add library_groups tag to swagger.yaml Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38291 --- Comment #22 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Created attachment 204387 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=204387&action=edit Bug 38291: (QA follow-up) Update id swagger definition to match db Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38291 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |release-notes-needed -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38291 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |andrew@bywatersolutions.com See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=42625 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38291 Jacob O'Mara <jacob.omara@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jacob.omara@openfifth.co.uk Status|Passed QA |ASSIGNED --- Comment #23 from Jacob O'Mara <jacob.omara@openfifth.co.uk> --- I'd like to add a small follow-up to this as I think we should add a to_api_mapping for branchcode to map it to library_id. Since Matt is OOO today, I'll put this in Assigned so it doesn't get pushed while I'm waiting on confirmation from him, -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38291 --- Comment #24 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Hi, I believe we could work a bit more on those `ft*` attribute names? also `parent_id` could be `parent_library_id`? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38291 --- Comment #25 from Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> --- This was originally intended for another feature that no longer requires it - if it is needed for something else then improving to_api_mapping makes sense to me -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38291 Jacob O'Mara <jacob.omara@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38291 --- Comment #26 from Jacob O'Mara <jacob.omara@openfifth.co.uk> --- Created attachment 207291 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=207291&action=edit Bug 38291: (QA follow-up) Map attributes to API naming conventions Signed-off-by: Jacob O'Mara <jacob.omara@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38291 --- Comment #27 from Jacob O'Mara <jacob.omara@openfifth.co.uk> --- Added some to_api_mappings and renamed the ft attribute mappings as suggested. 'parent_id' I've left as it is and I think it's conventionally correct. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38291 Jacob O'Mara <jacob.omara@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |42625 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42625 [Bug 42625] Allow records to be locked for editing based on library & group -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38291 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |rel_26_11_candidate -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38291 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |In Discussion --- Comment #28 from David Cook <dcook@prosentient.com.au> --- Hmmm technically this might leak information. admin/library_groups.pl itself requires "parameters => manage_libraries". A staff side API should require the same permissions - even if it's "only" a GET endpoint. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38291 --- Comment #29 from David Cook <dcook@prosentient.com.au> --- (In reply to Matt Blenkinsop from comment #25)
This was originally intended for another feature that no longer requires it - if it is needed for something else then improving to_api_mapping makes sense to me
Do you mind talking a bit more about the feature? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38291 --- Comment #30 from David Cook <dcook@prosentient.com.au> --- (In reply to David Cook from comment #28)
Hmmm technically this might leak information.
While the information might not be particularly sensitive, it does still cross an authorization boundary and creates a discrepancy between the server-side rendered UI and the API. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38291 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |martin.renvoize@openfifth.c | |o.uk Assignee|matt.blenkinsop@openfifth.c |jacob.omara@openfifth.co.uk |o.uk | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38291 --- Comment #31 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Re-assigning to Jacob as he appears to have taken it over. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38291 --- Comment #32 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- I'd argue that the permission to list library groups is equivalent to the ability to list libraries. The API route to list libraries only requires basic catalogue permission, matching what's used for listing library groups. There is no page in the staff interface to simply view a list of all branches if one does not have admin permissions, but numerous places need to provide the user that list in the course of other functionality (editing patrons, items, etc). There is not yet any place in the Koha UI where a user selects from a list of library groups, but this route is used to create one. Bug 42625 allows record sources to be tied to library groups and allow users from that group to edit locked records from that source. (Elsewhere we manage similar group-aware access restrictions by asking the user to limit to a specific library and then allowing that to imply access to other libraries based on groups -- see the reports limits by library group introduced in Bug 42621. That avoids this question of making a list of groups visible to the user, but is arguably less clear for the user.) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38291 --- Comment #33 from Jacob O'Mara <jacob.omara@openfifth.co.uk> --- Created attachment 210620 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210620&action=edit Bug 38291: (follow-up) Add ft_reports to the library groups API -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38291 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kyle@bywatersolutions.com --- Comment #34 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- I went looking for prior art based on what Andrew wrote. These are API endpoints that only need the catalogue permission to read: * /libraries * /libraries/{library_id}/desks * /libraries/{library_id}/cash_registers * /patron_categories * /item_types * /authorised_value_categories/{authorised_value_category_name}/authorised_values * /cities * /quotes * /circulation_rules So it does seem like there is precedence. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38291 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|In Discussion |Passed QA --- Comment #35 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- I'm setting this back to PQA based on Kyle's comment, but am happy to discuss further as desired. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38291 --- Comment #36 from David Cook <dcook@prosentient.com.au> --- (In reply to Kyle M Hall (khall) from comment #34)
I went looking for prior art based on what Andrew wrote.
I think that I'd call that technical debt rather than prior art 😅 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38291 --- Comment #37 from David Cook <dcook@prosentient.com.au> --- (In reply to David Cook from comment #29)
(In reply to Matt Blenkinsop from comment #25)
This was originally intended for another feature that no longer requires it - if it is needed for something else then improving to_api_mapping makes sense to me
Do you mind talking a bit more about the feature?
(In reply to Andrew Fuerste-Henry from comment #35)
I'm setting this back to PQA based on Kyle's comment, but am happy to discuss further as desired.
Yeah, let's do it. I don't think Kyle's comment addresses my concerns. What's the use case for this endpoint? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38291 --- Comment #38 from David Cook <dcook@prosentient.com.au> --- (In reply to Andrew Fuerste-Henry from comment #32) Sorry I missed this comment. Reading through it now...
I'd argue that the permission to list library groups is equivalent to the ability to list libraries. The API route to list libraries only requires basic catalogue permission, matching what's used for listing library groups.
I'd bring your attention to the 1st patch here that doesn't just list library groups, but rather shows you parent_id, branchcode, title, description, ft_hide_patron_info, ft_limit_item_editing, ft_search_groups_opac, ft_search_groups_staff, ft_local_hold_group, and ft_local_float_group. A lot of that information should only be privy to someone with "manage_libraries" permissions.
There is no page in the staff interface to simply view a list of all branches if one does not have admin permissions, but numerous places need to provide the user that list in the course of other functionality (editing patrons, items, etc). There is not yet any place in the Koha UI where a user selects from a list of library groups, but this route is used to create one. Bug 42625 allows record sources to be tied to library groups and allow users from that group to edit locked records from that source.
Thanks for this example. For this use case, you really just need a list of library groups including their title and description. (And really it should just be a list of libraries/library groups that the user calling the API endpoint is allowed to see. At this point, I don't think we restrict any views of that even with IndependentBranches, but I suspect one day we will want that.) To date in Koha we've been overly obsessed with the idea of a REST API to the detriment of performance and security.
(Elsewhere we manage similar group-aware access restrictions by asking the user to limit to a specific library and then allowing that to imply access to other libraries based on groups -- see the reports limits by library group introduced in Bug 42621. That avoids this question of making a list of groups visible to the user, but is arguably less clear for the user.)
As I said in my other comment, I don't think other parts of Koha are good examples to point to. We have *a lot* of work to do to handle authorization consistently/well in Koha. -- Going back to the features... consider this. For this particular use case, there's no specific feature, so you probably would want something like "list/all". For listing the library groups for OPAC search groups, it should be something like "list/search_groups_opac", so that the API outputs the actual resource needed by the system, rather than the database model. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38291 --- Comment #39 from David Cook <dcook@prosentient.com.au> --- That is to say, the API endpoint used to "manage" library groups (e.g. http://localhost:8081/cgi-bin/koha/admin/library_groups.pl if it were API-driven) would not be the same as the API endpoint to "consume" library groups. By thinking about the problem from the UI first instead of the DB first, I think we'll find more logical approaches to data problems. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38291 --- Comment #40 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- (In reply to David Cook from comment #38)
Thanks for this example. For this use case, you really just need a list of library groups including their title and description. (And really it should just be a list of libraries/library groups that the user calling the API endpoint is allowed to see. At this point, I don't think we restrict any views of that even with IndependentBranches, but I suspect one day we will want that.)
This use case also relies on knowing whether or not a given group has the "use for record source locking" feature enabled, so that one can only tie a record source to a library group that is set to be used for record sources. Any future use of this API will want to function similarly, filtering to only groups that are relevant to the issue at hand. I suppose that could be handled by putting a query in the API request ("list the groups that are set to use for record source locking") rather than getting all groups and all the data about each of them. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38291 Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC|caroline.cyr-la-rose@inlibr | |o.com | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38291 Pedro Amorim (ammopt) <pedro.amorim@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Patch doesn't apply CC| |pedro.amorim@openfifth.co.u | |k -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38291 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Patch doesn't apply |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38291 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #204385|0 |1 is obsolete| | Attachment #204386|0 |1 is obsolete| | Attachment #204387|0 |1 is obsolete| | Attachment #207291|0 |1 is obsolete| | Attachment #210620|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38291 --- Comment #41 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 211109 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211109&action=edit Bug 38291: Add a unit test (cherry picked from commit 9f9c2a0678c42ec5ac4016dd2ef603232150e770) Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com> Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38291 --- Comment #42 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 211110 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211110&action=edit Bug 38291: (QA follow-up) Add library_groups tag to swagger.yaml Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38291 --- Comment #43 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 211111 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211111&action=edit Bug 38291: (QA follow-up) Update id swagger definition to match db Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38291 --- Comment #44 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 211112 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211112&action=edit Bug 38291: (QA follow-up) Map attributes to API naming conventions Signed-off-by: Jacob O'Mara <jacob.omara@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38291 --- Comment #45 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 211113 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211113&action=edit Bug 38291: (follow-up) Add ft_reports to the library groups API -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38291 Pedro Amorim (ammopt) <pedro.amorim@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Failed QA --- Comment #46 from Pedro Amorim (ammopt) <pedro.amorim@openfifth.co.uk> --- First patch (Aug 28) still doesn't apply for me. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38291 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #204384|0 |1 is obsolete| | Attachment #211109|0 |1 is obsolete| | Attachment #211110|0 |1 is obsolete| | Attachment #211111|0 |1 is obsolete| | Attachment #211112|0 |1 is obsolete| | Attachment #211113|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38291 --- Comment #47 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 211117 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211117&action=edit Bug 38291: Add an endpoint to list library groups (cherry picked from commit cd2440165f62e96410df9d11bb3aab578d028016) Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com> Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38291 --- Comment #48 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 211118 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211118&action=edit Bug 38291: Add a unit test (cherry picked from commit 9f9c2a0678c42ec5ac4016dd2ef603232150e770) Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com> Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38291 --- Comment #49 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 211119 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211119&action=edit Bug 38291: (QA follow-up) Add library_groups tag to swagger.yaml Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38291 --- Comment #50 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 211120 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211120&action=edit Bug 38291: (QA follow-up) Update id swagger definition to match db Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38291 --- Comment #51 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 211121 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211121&action=edit Bug 38291: (QA follow-up) Map attributes to API naming conventions Signed-off-by: Jacob O'Mara <jacob.omara@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38291 --- Comment #52 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 211122 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211122&action=edit Bug 38291: (follow-up) Add ft_reports to the library groups API -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38291 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Passed QA --- Comment #53 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Rebased patches uploaded correctly this time, thanks! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38291 --- Comment #54 from David Cook <dcook@prosentient.com.au> --- (In reply to Andrew Fuerste-Henry from comment #40)
This use case also relies on knowing whether or not a given group has the "use for record source locking" feature enabled, so that one can only tie a record source to a library group that is set to be used for record sources. Any future use of this API will want to function similarly, filtering to only groups that are relevant to the issue at hand.
You're conflating things a bit here. The user does not need to know if a given group has a "use for record source locking" feature. They just need to know which groups are available for record source locking. They're two different but related ideas.
I suppose that could be handled by putting a query in the API request ("list the groups that are set to use for record source locking") rather than getting all groups and all the data about each of them.
I think you've missed my point all together. One use case is management of Koha configuration (even if that management is just the R in CRUD or view action). Your use case is getting the library groups available for a particular action. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38291 --- Comment #55 from David Cook <dcook@prosentient.com.au> --- I can see this has been moved back to "Passed QA". Ok. We can tackle this one later when it's reported as an access control / information disclosure CVE. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38291 --- Comment #56 from David Cook <dcook@prosentient.com.au> --- (In reply to David Cook from comment #55)
I can see this has been moved back to "Passed QA". Ok. We can tackle this one later when it's reported as an access control / information disclosure CVE.
You don't have to take my word for it. Ask an AI. It'll say it's a low risk / low severity issue, but I anticipate it would suggest not exposing the library_groups data in this way. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38291 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #211117|0 |1 is obsolete| | Attachment #211118|0 |1 is obsolete| | Attachment #211119|0 |1 is obsolete| | Attachment #211120|0 |1 is obsolete| | Attachment #211121|0 |1 is obsolete| | Attachment #211122|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38291 --- Comment #57 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 211198 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211198&action=edit Bug 38291: Add an endpoint to list library groups (cherry picked from commit cd2440165f62e96410df9d11bb3aab578d028016) Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com> Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38291 --- Comment #58 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 211199 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211199&action=edit Bug 38291: Add a unit test (cherry picked from commit 9f9c2a0678c42ec5ac4016dd2ef603232150e770) Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com> Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38291 --- Comment #59 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 211200 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211200&action=edit Bug 38291: (QA follow-up) Add library_groups tag to swagger.yaml Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38291 --- Comment #60 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 211201 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211201&action=edit Bug 38291: (QA follow-up) Update id swagger definition to match db Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38291 --- Comment #61 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 211202 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211202&action=edit Bug 38291: (QA follow-up) Map attributes to API naming conventions Signed-off-by: Jacob O'Mara <jacob.omara@openfifth.co.uk> Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38291 --- Comment #62 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 211203 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211203&action=edit Bug 38291: (follow-up) Add ft_reports to the library groups API Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38291 --- Comment #63 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 211204 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211204&action=edit Bug 38291: (QA follow-up) Require manage_libraries to list library groups GET /library_groups returns the full library group configuration, including the hide_patron_info, limit_item_editing and limit_report_access policy flags, and allows filtering on them. The staff interface page that exposes the same data (admin/library_groups.pl) requires the parameters => manage_libraries permission, but the endpoint only required catalogue. Align the endpoint with the admin page so a catalogue-only user cannot read (or probe via q) the group access control settings, and document the 403 response. Consumers that only need to know which groups are available for a given purpose should get a dedicated, narrower endpoint rather than this management representation. To test: 1. Run prove t/db_dependent/api/v1/library_groups.t => SUCCESS: a catalogue-only user gets 403, a user with manage_libraries (superlibrarian) gets 200 2. Run yarn build and prove xt/api.t => SUCCESS: the spec is valid Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38291 --- Comment #64 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- David, I agree with your concerns here, and I think the original patch was wrong to expose this at the catalogue permission level. The endpoint returns the full library group configuration, including the hide_patron_info, limit_item_editing and limit_report_access policy flags, and lets callers filter on them via q. That is access control configuration rather than lookup data. admin/library_groups.pl requires manage_libraries for the same data, so the API should too. I accept that the other catalogue-gated endpoints are better described as technical debt than as precedent, and that the data they expose is much less sensitive than this. I've attached a follow-up that changes GET /library_groups to require parameters => manage_libraries, documents the 403 response, and adds test coverage (a catalogue-only user gets 403, a user with manage_libraries gets 200). I believe this resolves the authorization boundary and information disclosure concern. This endpoint is now the "manage" representation of library groups. I agree with your point that consuming library groups for a specific purpose is a different resource. Rather than loosening permissions here, I'll add purpose-specific endpoints on the bugs that need to consume library groups (for example, the groups available for record source locking on Bug 42625), returning only what that feature needs and without exposing the policy flags or allowing filtering on them. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38291 Pedro Amorim (ammopt) <pedro.amorim@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Failed QA --- Comment #65 from Pedro Amorim (ammopt) <pedro.amorim@openfifth.co.uk> --- Hi all: 1) All 7 boolean filter query parameters on GET /library_groups (hide_patron_info, is_opac_search_group, is_staff_search_group, is_local_hold_group, is_local_float_group, limit_item_editing, limit_report_access) are typed integer, but the endpoint returns those attributes as booleans. A client that filters with the value it reads back gets a 400. Changing the parameter type after release would be an API change. 2) In api/v1/swagger/definitions/library_group.yaml, hide_patron_info is not listed under 'required', but the other 6 boolean attributes are. These 7 columns are all NOT NULL. To reproduce 1: 1) Apply the patches, then run 'yarn api:bundle' and 'koha-plack --restart kohadev' 2) Log in to the staff interface as koha and go to http://localhost:8081/cgi-bin/koha/admin/library_groups.pl 3) Click the 'New group' button, enter 'Test group' as the title, tick 'Is local hold group' and click 'Save' 4) In the same browser, go to http://localhost:8081/api/v1/library_groups 5) Confirm 'Test group' is returned with "is_local_hold_group": true 6) Go to http://localhost:8081/api/v1/library_groups?is_local_hold_group=true 7) Confirm you get a 400 'Expected integer' 8) Go to http://localhost:8081/api/v1/library_groups?is_local_hold_group=1 9) Confirm you get a 200 and 'Test group' is returned Non-blockers: - t/db_dependent/api/v1/library_groups.t imports List::Util qw(min), but it is never used. - created_on and updated_on have no format: date-time, and updated_on allows null although the column is NOT NULL. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38291 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #211198|0 |1 is obsolete| | Attachment #211199|0 |1 is obsolete| | Attachment #211200|0 |1 is obsolete| | Attachment #211201|0 |1 is obsolete| | Attachment #211202|0 |1 is obsolete| | Attachment #211203|0 |1 is obsolete| | Attachment #211204|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38291 --- Comment #66 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 211207 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211207&action=edit Bug 38291: Add an endpoint to list library groups Library groups are configured in Administration > Library groups, but they cannot be read through the REST API. Add GET /api/v1/library_groups which lists the library groups with the usual paging, sorting and q searching. The library_groups table holds both the groups and the libraries that belong to them, so the list contains an entry for each group and an entry for each library added to a group. Groups carry a title, a description, an optional parent group and the feature flags set in the administration page (hide patron info, limit item editing, search groups, local hold and float groups). Reading the list requires the catalogue permission. The route is implemented by the new Koha::REST::V1::LibraryGroups controller, with its swagger path and definition. To test: 1. Apply the patches, then run yarn build and restart_all 2. Administration > Library groups: create a group "Consortium", then add two sub groups to it, "Region 1" and "Region 2". Use "Add library" to add a library to "Region 1" 3. Log in to the staff interface as a superlibrarian and, in the same browser, visit /api/v1/library_groups => SUCCESS: a JSON list with an entry for each group, and one for the library you added, showing the title and description of the groups 4. Visit /api/v1/library_groups?title=Region%201 => SUCCESS: only the "Region 1" group is listed 5. Visit /api/v1/library_groups?_per_page=1&_page=2 => SUCCESS: a single entry is listed, the second one Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com> Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38291 --- Comment #67 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 211208 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211208&action=edit Bug 38291: Add a unit test Add t/db_dependent/api/v1/library_groups.t for GET /api/v1/library_groups. It checks that an authorized user gets a 200 response, and that the list has as many entries as there are rows in the library_groups table. To test: 1. Apply the patches, then run yarn api:bundle and restart_all 2. Run: prove t/db_dependent/api/v1/library_groups.t => SUCCESS: Tests pass Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com> Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38291 --- Comment #68 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 211209 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211209&action=edit Bug 38291: (QA follow-up) Add library_groups tag to swagger.yaml The new /library_groups path is tagged library_groups, but the tag was not declared in the list of tags at the top level of swagger.yaml, so xt/api.t fails with: get /library_groups -> uses tag 'library_groups' not present in top level list Declare the tag, with a display name for the API documentation. To test: 1. Apply the patches up to, but not including, this one and run yarn api:bundle 2. Run: prove xt/api.t => FAIL: the tag error above is reported 3. Apply this patch and run yarn api:bundle again 4. Run: prove xt/api.t => SUCCESS: Tests pass Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38291 --- Comment #69 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 211210 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211210&action=edit Bug 38291: (QA follow-up) Update id swagger definition to match db library_groups.id is an auto increment int(11) column, and the API returns it as a number, but the swagger definition described it as a string of at most 10 characters. Describe it as a read only integer so that the specification matches the database and what the API returns. To test: 1. Apply the patches, then run yarn api:bundle and restart_all 2. Log in to the staff interface as a superlibrarian and visit /api/v1/library_groups => SUCCESS: the identifier of each group is a number, for example 3, and not a string 3. Run: prove t/db_dependent/api/v1/library_groups.t xt/api.t => SUCCESS: Tests pass Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38291 --- Comment #70 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 211211 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211211&action=edit Bug 38291: (QA follow-up) Map attributes to API naming conventions The endpoint returned the raw database column names. Add Koha::Library::Group->to_api_mapping and rename the attributes in the swagger definition and query parameters to follow the API naming conventions: id => library_group_id branchcode => library_id ft_hide_patron_info => hide_patron_info ft_limit_item_editing => limit_item_editing ft_search_groups_opac => is_opac_search_group ft_search_groups_staff => is_staff_search_group ft_local_hold_group => is_local_hold_group ft_local_float_group => is_local_float_group The descriptions of the attributes now explain what each one does, instead of repeating the column name. parent_id keeps its name, as it identifies the parent library group. To test: 1. Apply the patches, then run yarn api:bundle and restart_all 2. Administration > Library groups: create a group "Searchable" with "Use for OPAC search groups" checked and add a library to it 3. Log in to the staff interface as a superlibrarian and visit /api/v1/library_groups => SUCCESS: the entries use library_group_id, library_id, hide_patron_info, limit_item_editing, is_opac_search_group, is_staff_search_group, is_local_hold_group and is_local_float_group => SUCCESS: "Searchable" has is_opac_search_group true 4. Visit /api/v1/library_groups?is_opac_search_group=1 => SUCCESS: only the groups used for OPAC search are listed 5. Visit /api/v1/library_groups?library_id=<branchcode of the library you added> => SUCCESS: only the entry for that library in the group is listed 6. Run: prove t/db_dependent/api/v1/library_groups.t xt/api.t => SUCCESS: Tests pass Signed-off-by: Jacob O'Mara <jacob.omara@openfifth.co.uk> Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38291 --- Comment #71 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 211212 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211212&action=edit Bug 38291: (follow-up) Add ft_reports to the library groups API Library groups have a "Limit report access by group" setting (ft_reports), but it was left out of the API representation. Map it to limit_report_access, and add it to the swagger definition and to the query parameters of the endpoint. To test: 1. Apply the patches, then run yarn api:bundle and restart_all 2. Administration > Library groups: create a group "Reports group" with "Limit report access by group" checked, and another group without it 3. Log in to the staff interface as a superlibrarian and visit /api/v1/library_groups => SUCCESS: "Reports group" has limit_report_access true, and the other group has it false 4. Visit /api/v1/library_groups?limit_report_access=1 => SUCCESS: only "Reports group" is listed 5. Run: prove t/db_dependent/api/v1/library_groups.t xt/api.t => SUCCESS: Tests pass Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38291 --- Comment #72 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 211213 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211213&action=edit Bug 38291: (QA follow-up) Require manage_libraries to list library groups GET /library_groups returns the full library group configuration, including the hide_patron_info, limit_item_editing and limit_report_access policy flags, and allows filtering on them. The staff interface page that exposes the same data (admin/library_groups.pl) requires the parameters => manage_libraries permission, but the endpoint only required catalogue. Align the endpoint with the admin page so a catalogue-only user cannot read (or probe via q) the group access control settings, and document the 403 response. Consumers that only need to know which groups are available for a given purpose should get a dedicated, narrower endpoint rather than this management representation. To test: 1. Apply the patches, then run yarn api:bundle and restart_all 2. Administration > Library groups: create a group, with one of the "Limit ... by group" settings checked 3. Create a staff user with only the catalogue permission, and another with only Parameters > Manage libraries (manage_libraries). Neither is a superlibrarian 4. Log in as the catalogue user and visit /api/v1/library_groups => SUCCESS: the response is a 403, "Authorization failure. Missing required permission(s)." 5. Log in as the user with manage_libraries and visit /api/v1/library_groups => SUCCESS: the list of library groups is shown 6. Log in as a superlibrarian and visit /api/v1/library_groups => SUCCESS: the list of library groups is shown 7. Run: prove t/db_dependent/api/v1/library_groups.t xt/api.t => SUCCESS: Tests pass Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38291 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #211207|0 |1 is obsolete| | Attachment #211208|0 |1 is obsolete| | Attachment #211209|0 |1 is obsolete| | Attachment #211210|0 |1 is obsolete| | Attachment #211211|0 |1 is obsolete| | Attachment #211212|0 |1 is obsolete| | Attachment #211213|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38291 --- Comment #73 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 211232 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211232&action=edit Bug 38291: Add an endpoint to list library groups Library groups are configured in Administration > Library groups, but they cannot be read through the REST API. Add GET /api/v1/library_groups which lists the library groups with the usual paging, sorting and q searching. The library_groups table holds both the groups and the libraries that belong to them, so the list contains an entry for each group and an entry for each library added to a group. Groups carry a title, a description, an optional parent group and the feature flags set in the administration page (hide patron info, limit item editing, search groups, local hold and float groups). Reading the list requires the catalogue permission. The route is implemented by the new Koha::REST::V1::LibraryGroups controller, with its swagger path and definition. To test: 1. Apply the patches, then run yarn build and restart_all 2. Administration > Library groups: create a group "Consortium", then add two sub groups to it, "Region 1" and "Region 2". Use "Add library" to add a library to "Region 1" 3. Log in to the staff interface as a superlibrarian and, in the same browser, visit /api/v1/library_groups => SUCCESS: a JSON list with an entry for each group, and one for the library you added, showing the title and description of the groups 4. Visit /api/v1/library_groups?q={"title":"Region 1"} => SUCCESS: only the "Region 1" group is listed 5. Visit /api/v1/library_groups?_per_page=1&_page=2 => SUCCESS: a single entry is listed, the second one Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com> Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38291 --- Comment #74 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 211233 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211233&action=edit Bug 38291: Add a unit test Add t/db_dependent/api/v1/library_groups.t for GET /api/v1/library_groups. It checks that an authorized user gets a 200 response, and that the list has as many entries as there are rows in the library_groups table. To test: 1. Apply the patches, then run yarn api:bundle and restart_all 2. Run: prove t/db_dependent/api/v1/library_groups.t => SUCCESS: Tests pass Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com> Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38291 --- Comment #75 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 211234 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211234&action=edit Bug 38291: (QA follow-up) Add library_groups tag to swagger.yaml The new /library_groups path is tagged library_groups, but the tag was not declared in the list of tags at the top level of swagger.yaml, so xt/api.t fails with: get /library_groups -> uses tag 'library_groups' not present in top level list Declare the tag, with a display name for the API documentation. To test: 1. Apply the patches up to, but not including, this one and run yarn api:bundle 2. Run: prove xt/api.t => FAIL: the tag error above is reported 3. Apply this patch and run yarn api:bundle again 4. Run: prove xt/api.t => SUCCESS: Tests pass Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38291 --- Comment #76 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 211235 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211235&action=edit Bug 38291: (QA follow-up) Update id swagger definition to match db library_groups.id is an auto increment int(11) column, and the API returns it as a number, but the swagger definition described it as a string of at most 10 characters. Describe it as a read only integer so that the specification matches the database and what the API returns. To test: 1. Apply the patches, then run yarn api:bundle and restart_all 2. Log in to the staff interface as a superlibrarian and visit /api/v1/library_groups => SUCCESS: the identifier of each group is a number, for example 3, and not a string 3. Run: prove t/db_dependent/api/v1/library_groups.t xt/api.t => SUCCESS: Tests pass Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38291 --- Comment #77 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 211236 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211236&action=edit Bug 38291: (QA follow-up) Map attributes to API naming conventions The endpoint returned the raw database column names. Add Koha::Library::Group->to_api_mapping and rename the attributes in the swagger definition and query parameters to follow the API naming conventions: id => library_group_id branchcode => library_id ft_hide_patron_info => hide_patron_info ft_limit_item_editing => limit_item_editing ft_search_groups_opac => is_opac_search_group ft_search_groups_staff => is_staff_search_group ft_local_hold_group => is_local_hold_group ft_local_float_group => is_local_float_group The descriptions of the attributes now explain what each one does, instead of repeating the column name. parent_id keeps its name, as it identifies the parent library group. To test: 1. Apply the patches, then run yarn api:bundle and restart_all 2. Administration > Library groups: create a group "Searchable" with "Use for OPAC search groups" checked and add a library to it 3. Log in to the staff interface as a superlibrarian and visit /api/v1/library_groups => SUCCESS: the entries use library_group_id, library_id, hide_patron_info, limit_item_editing, is_opac_search_group, is_staff_search_group, is_local_hold_group and is_local_float_group => SUCCESS: "Searchable" has is_opac_search_group true 4. Visit /api/v1/library_groups?q={"is_opac_search_group":true} => SUCCESS: only the groups used for OPAC search are listed 5. Visit /api/v1/library_groups?q={"library_id":"<branchcode of the library you added>"} => SUCCESS: only the entry for that library in the group is listed 6. Run: prove t/db_dependent/api/v1/library_groups.t xt/api.t => SUCCESS: Tests pass Signed-off-by: Jacob O'Mara <jacob.omara@openfifth.co.uk> Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38291 --- Comment #78 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 211237 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211237&action=edit Bug 38291: (follow-up) Add ft_reports to the library groups API Library groups have a "Limit report access by group" setting (ft_reports), but it was left out of the API representation. Map it to limit_report_access, and add it to the swagger definition and to the query parameters of the endpoint. To test: 1. Apply the patches, then run yarn api:bundle and restart_all 2. Administration > Library groups: create a group "Reports group" with "Limit report access by group" checked, and another group without it 3. Log in to the staff interface as a superlibrarian and visit /api/v1/library_groups => SUCCESS: "Reports group" has limit_report_access true, and the other group has it false 4. Visit /api/v1/library_groups?q={"limit_report_access":true} => SUCCESS: only "Reports group" is listed 5. Run: prove t/db_dependent/api/v1/library_groups.t xt/api.t => SUCCESS: Tests pass Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38291 --- Comment #79 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 211238 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211238&action=edit Bug 38291: (QA follow-up) Require manage_libraries to list library groups GET /library_groups returns the full library group configuration, including the hide_patron_info, limit_item_editing and limit_report_access policy flags, and allows filtering on them. The staff interface page that exposes the same data (admin/library_groups.pl) requires the parameters => manage_libraries permission, but the endpoint only required catalogue. Align the endpoint with the admin page so a catalogue-only user cannot read (or probe via q) the group access control settings, and document the 403 response. Consumers that only need to know which groups are available for a given purpose should get a dedicated, narrower endpoint rather than this management representation. To test: 1. Apply the patches, then run yarn api:bundle and restart_all 2. Administration > Library groups: create a group, with one of the "Limit ... by group" settings checked 3. Create a staff user with only the catalogue permission, and another with only Parameters > Manage libraries (manage_libraries). Neither is a superlibrarian 4. Log in as the catalogue user and visit /api/v1/library_groups => SUCCESS: the response is a 403, "Authorization failure. Missing required permission(s)." 5. Log in as the user with manage_libraries and visit /api/v1/library_groups => SUCCESS: the list of library groups is shown 6. Log in as a superlibrarian and visit /api/v1/library_groups => SUCCESS: the list of library groups is shown 7. Run: prove t/db_dependent/api/v1/library_groups.t xt/api.t => SUCCESS: Tests pass Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38291 --- Comment #80 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 211239 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211239&action=edit Bug 38291: (QA follow-up) Tidy up the library group definition and test - hide_patron_info is required, like the other flags: all the flag columns are NOT NULL, and the API always returns them - created_on and updated_on are date-times, and read only. updated_on cannot be null, as library_groups.updated_on is NOT NULL - remove the List::Util import that the test does not use To test: 1. Apply the patches, then run yarn api:bundle and restart_all 2. Log in to the staff interface as a superlibrarian and visit /api/v1/library_groups => SUCCESS: created_on and updated_on are dates, for example 2026-11-09T11:14:34+00:00, and every group has hide_patron_info 3. Run: prove t/db_dependent/api/v1/library_groups.t xt/api.t => SUCCESS: Tests pass Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38291 --- Comment #81 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 211240 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211240&action=edit Bug 38291: (QA follow-up) Filter library groups with q only The endpoint declared a query parameter for every attribute of a library group, which only repeat what the q parameter does. For the boolean attributes they were also wrong: they were declared as integers although the API returns booleans, so filtering with a value read back from the API, for example ?is_local_hold_group=true, was refused. Declaring them as booleans would not have been enough. Plain query parameters are matched with like, and any value that is not empty counts as true, so ?is_local_hold_group=false (and =0) would list the groups that have the flag set. Other routes behave the same way, for instance /patrons?protected=false lists the protected patrons. /libraries, which this route follows, filters its boolean attributes with q, and nothing needs the plain parameters here: each one that is published is a promise to keep supporting it. Remove them, and test that every attribute that is a flag can be filtered with q, with true and false. To test: 1. Apply the patches, then run yarn api:bundle and restart_all 2. Administration > Library groups: create a group "Hold group" with "Is local hold group" checked, and a group "Other" without it 3. Log in to the staff interface as a superlibrarian and visit /api/v1/library_groups?q={"is_local_hold_group":true} => SUCCESS: "Hold group" is listed, and "Other" is not 4. Visit /api/v1/library_groups?q={"is_local_hold_group":false} => SUCCESS: "Other" is listed, and "Hold group" is not 5. Visit /api/v1/library_groups?q={"title":"Other"} => SUCCESS: only "Other" is listed 6. Run: prove t/db_dependent/api/v1/library_groups.t xt/api.t => SUCCESS: Tests pass Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38291 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Passed QA --- Comment #82 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Thanks Pedro, good catches. I have reworked this in follow-up patches. 1) Boolean filters. You are right that the integer typed parameters could not be used with the values the API returns. Declaring them as booleans was not enough, though: plain query parameters are matched with like and any value that is not empty counts as true, so ?is_local_hold_group=false (and =0, which already behaved that way) lists the groups that have the flag set. Generic list routes behave like this in general, for instance /patrons?protected=false lists the protected patrons. That deserves its own bug. /libraries, which this route follows, does not declare its boolean attributes either: they are filtered with q. Nothing uses the plain parameters here (the other bugs use q or a dedicated route), and every parameter we publish is a promise to keep it, so I have removed the attribute query parameters. q handles booleans correctly, for example q={"is_local_hold_group":false}, and the tests cover every flag with true and false. 2) hide_patron_info is now required, like the other flag columns. Non-blockers: removed the unused List::Util import, added format date-time to created_on and updated_on (both read only), and updated_on is no longer nullable, as its column is NOT NULL. created_on stays nullable, because its column is. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38291 Pedro Amorim (ammopt) <pedro.amorim@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |26.11.00 released in| | Status|Passed QA |Pushed to main -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38291 --- Comment #83 from Pedro Amorim (ammopt) <pedro.amorim@openfifth.co.uk> --- Thanks everyone! Pushed to main for 26.11! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38291 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Text to go in the| |New REST API endpoint `GET release notes| |/api/v1/library_groups` | |lists library groups, and | |an entry for each library | |added to a group, with | |paging, sorting and `q` | |searching. Each entry gives | |the group's title, | |description, parent group, | |the libraries it contains | |and its access flags (hide | |patron info, limit item | |editing, limit report | |access, OPAC and staff | |search groups, local hold | |and float groups). Requires | |the `manage_libraries` | |permission, as the Library | |groups page does. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38291 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to main |Needs documenting --- Comment #84 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Enhancement, no 26.05.x backport. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org