https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44051 Bug ID: 44051 Summary: Add a narrow library groups route for record source editing Initiative type: --- Sponsorship --- status: 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: martin.renvoize@openfifth.co.uk QA Contact: tomascohen@gmail.com CC: tomascohen@gmail.com Target Milestone: --- Bug 42625 adds a selector to the record source form that lists the library groups flagged for record source editing. It gets them from GET /api/v1/library_groups, which Bug 38291 restricts to the manage_libraries permission because it returns the full library group configuration, including the policy flags (hide patron info, limit item editing, limit report access). A user who is allowed to manage record sources but not libraries therefore gets a 403 and an empty selector. Add GET /api/v1/record_source_editing_groups, authorized by manage_record_sources: - it only lists the groups flagged for record source editing - it only returns library_group_id, title and description - q, _order_by, _match and paging work on those fields. Filtering or sorting on anything else is rejected with invalid_query, however the field is spelled, so the policy flags cannot be read or probed through it The controller keeps the flag column and the allowed fields of each feature in one table, so other features that let users pick a library group can add a route with their own permission. Test plan: 1. Apply the patches, run yarn api:bundle and yarn js:build, then restart Plack 2. Administration > Library groups: create a group with "Use for record source editing" checked, and another without it 3. Create a staff user who is not a superlibrarian, with the catalogue permission and Parameters > manage_record_sources 4. As that user, Administration > Record sources > New record source => The "Editable by library groups" selector lists only the first group 5. As the same user, request /api/v1/record_source_editing_groups?_order_by=hide_patron_info, then /api/v1/library_groups => 400 invalid_query, then 403 -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.