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

--- Comment #20 from Tomás Cohen Arazi <[email protected]> ---
(In reply to Martin Renvoize from comment #18)
> Created attachment 128048 [details] [review]
> ALT: An idea of doing it at singular level?
> 
> In this patch I add 'user', containing the Koha::Patron object for the
> logged in user in the params hash we pass around in to_api. I then use
> that in a new 'is_accessible_in_context' method added to Koha::Patron.
> 
> The method name is a bit of a mouthfull.. it could be 'is_limited' as
> it's really the equivilent of 'search_limited' in the plural class.. but
> I wasn't sure that was actually clearer... if we like it we could strip
> back out some of the work around search_related.
> 
> As an asside, I also update Koha::Patron->can_see_patrons_from to use
> Koha::Patron->libraries_where_can_see_patrons internally.. DRY!

I like your approach. Also, things like $self->libraries_where_can_see_patrons
in Koha::Patron could be cached and thus reused in further recursive calls.
That would be great, to mitigate the overhead this will introduce!

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[email protected]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to