https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42621

--- Comment #46 from Matt Blenkinsop <[email protected]> ---
Created attachment 206264
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=206264&action=edit
Bug 42621: (QA follow-up) Display and enforce limits to ungrouped libraries

When LimitReportsBy is set to library_group and a report is limited to a
library that is not in any group with "Limit report access by group"
enabled, the limit was enforced in the saved reports list but the
"Library limits" column showed "No limitation". Direct access via
can_access also ignored the limit entirely, because it only checked
qualifying groups.

An ungrouped library is now treated as a group of one. Two helpers are
added to Koha::Object::Limit::LibraryGroup:

- ungrouped_library_limits returns the limited libraries that are not
  members of any qualifying group
- library_group_limit_branchcodes returns every branchcode the limit
  resolves to (stored branchcodes plus all members of qualifying groups)

can_access uses the resolved branchcodes so listing and direct access
agree. The saved reports table shows group titles followed by any
ungrouped libraries as "Branch name (CODE)".

Test plan:
1. Set LimitReportsBy to Library group
2. Create a library group containing Centerville and Fairfield, tick
   "Limit report access by group"
3. As a superlibrarian at Centerville, create a report limited to
   Fairview (not in any group)
4. Saved reports list: the report is hidden
5. Set your library to Fairview, reload the saved reports list
6. The report is visible and the Library limits column shows
   "Fairview (FRV)" instead of "No limitation"
7. Edit the report and add Centerville to the limit. The column shows
   the group title followed by "Fairview (FRV)"
8. Log in as a non-manager user at Fairfield and open the report from
   step 3 by URL. Access is denied
9. prove t/db_dependent/Koha/Reports.t

Co-Authored-By: Claude Fable 5.1 <[email protected]>

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list -- [email protected]
To unsubscribe send an email to [email protected]
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to